summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Ensure that Literals in an Int# case are in rangewip/T10246Joachim Breitner2017-02-045-47/+62
| | | | | | | | | | This is one way to fix #10246 and #13171. The chosen path involves adding the invariant that the argument of MachInt/MachWord etc. is always in the appropriate range, and that the smart constructors for them (mkMachInt etc.) wrap arguments that are outside the range in the expected way. Differential Revision: https://phabricator.haskell.org/D810
* Expose cseExpr from CSEJoachim Breitner2017-02-041-1/+4
| | | | | | for the benefit of GHC API users who want to CSE single expressions. Differential Revision: https://phabricator.haskell.org/D3069
* New internal dynamic flag: Very aggressive inliningJoachim Breitner2017-02-042-1/+10
| | | | | | | | | | | | This flag overrides the inliner heuristics to inline something independent of cost, size, expected gains or boringness of the context. It still adheres to arity, simplifier phase control and loop breakers. This is not exposed via a command line flag and added for the benefit of GHC API users. Differential Revision: https://phabricator.haskell.org/D3069
* Fix comment (old file names) in mk/ and utils/Takenobu Tani2017-02-043-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | There ware some old file names (.lhs, ...) at comments. * mk/config.mk.in - compiler/hsSyn/HsExpr.lhs -> HsExpr.hs * utils/ghc-pkg/Main.hs - compiler/main/Packages.lhs -> Packages.hs * utils/genapply/Main.hs - CgRetConv.lhs -> * REMOVE THIS COMMENT (OLDER FILE THAN GHC6) * - Constants.lhs -> Constants.hs - compiler/codeGen/CgCallConv.lhs -> compiler/codeGen/StgCmmLayout.hs - Apply.hc -> Apply.cmm - HeapStackCheck.hc -> HeapStackCheck.cmm Reviewers: mpickering, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3077
* Don't panic when printing match with RecUpd contextMatthew Pickering2017-02-041-1/+2
| | | | | | | | | | | | Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3065 GHC Trac Issues: #12957
* Improve wrapTicks performance with lots of redundant source notesPeter Wortmann2017-02-041-5/+14
| | | | | | | | | | | | | | | | | | | | The old version had O(n^3) performance for n non-overlapping source notes and let floats each, which is exactly what happens with -g if we compile a list literal of length n. The idea here is simply to establish early which source notes will actually survive (e.g. use a left fold). The new code should be O(n) for list literals. Reviewers: austin, dfeuer, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3037 GHC Trac Issues: #11095
* Update binary submodule to 0.8.4.1Ben Gamari2017-02-041-0/+0
|
* Fix minusNatural exception to be UnderflowOleg Grenrus2017-02-041-2/+2
|
* Make split sections by default work againReid Barton2017-02-041-1/+1
| | | | | | | | | | | | | | | | | | Commit 266a9dc4c changed = to := in one place in mk/config.mk.in. This broke SupportsSplitSections because the variable LdIsGNULd that it depends on is not defined until later in the file. Test Plan: pushed to a wip/ branch for perf to build Reviewers: DemiMarie, austin, bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D3070 GHC Trac Issues: #13230
* Fix comment (old filename '.lhs') in libraries/Takenobu Tani2017-02-044-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip ci] There are some old file names (*.lhs) at comments. (I'm fixing to read source code by newcomers.) * libraries/base/GHC/Base.hs - compiler/deSugar/DsListComp.lhs - PrelRules.lhs x2 - Base.lhs * libraries/base/GHC/IO.hs - PrimOp.lhs - GHC.IO.lhs - GHC.Exception.lhs * libraries/base/GHC/Real.hs - compiler/prelude/PrelRules.lhs * libraries/ghc-prim/GHC/Magic.hs - MkId.lhs x2 Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3060
* Fix comment (old file names) in compiler/Takenobu Tani2017-02-042-2/+2
| | | | | | | | | | | | | | | | | | [skip ci] There ware some old file names (.lhs, ...) at comments. * compiler/ghc.mk - prelude/PrimOp.lhs -> prelude/PrimOp.hs * compiler/parser/cutils.h - PrimPacked.lhs -> compiler/utils/FastString.hs Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3076
* Fix comment (old file names) in rts/Takenobu Tani2017-02-047-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip ci] There ware some old file names (.lhs, ...) at comments. * rts/win32/ThrIOManager.c - Conc.lhs -> Conc.hs * rts/PrimOps.cmm - ByteCodeLink.lhs -> ByteCodeLink.hs - StgMiscClosures.hc -> StgMiscClosures.cmm * rts/AutoApply.h - AutoApply.hc -> AutoApply.cmm * rts/HeapStackCheck.cmm - PrimOps.hc -> PrimOps.cmm * rts/LdvProfile.h - Updates.hc -> Updates.cmm * rts/Schedule.c - StgStartup.hc -> StgStartup.cmm * rts/Weak.c - StgMiscClosures.hc -> StgMiscClosures.cmm Reviewers: bgamari, austin, erikd, simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3075
* Fix comment (old file names) in includes/Takenobu Tani2017-02-044-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip ci] There ware some old file names (.lhs, ...) at comments. * includes/rts/Bytecodes.h - ghc/compiler/ghci/ByteCodeGen.lhs -> ByteCodeAsm.hs * includes/rts/Constants.h - libraries/base/GHC/Conc.lhs -> libraries/base/GHC/Conc/Sync.hs * includes/rts/storage/FunTypes.h - utils/genapply/GenApply.hs -> utils/genappl/Main.hs - compiler/codeGen/CgCallConv.lhs -> compiler/codeGen/StgCmmLayout.hs * includes/stg/MiscClosures.h - compiler/codeGen/CgStackery.lhs -> compiler/codeGen/StgCmmArgRep.hs - HeapStackCheck.hc -> HeapStackCheck.cmm Reviewers: bgamari, austin, simonmar, erikd Reviewed By: erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3074
* Attempt to make lazy ST thread safeDavid Feuer2017-02-038-24/+306
| | | | | | | | | | | | | | | | | | | Use `noDuplicate#` to prevent lazy `ST` thunks from being evaluated in multiple GHC threads. Some lazy `ST` functions added laziness that did not seem to be useful (e.g., creating lazy pairs that will never be matched unless one of their components is demanded). Stripped that out. Reviewers: ekmett, simonpj, bgamari, simonmar, austin, hvr Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3038 GHC Trac Issues: #11760
* Use tyCoVarsOfType for CTyEqCan in shouldSplitWDSimon Peyton Jones2017-02-031-5/+47
| | | | | | An ASSERT failure in rewritableTyVars made me realise that there was an outright bug in shouldSplitWD. See the long Note [Splitting WD constraints].
* Bump performance mark for T9020Joachim Breitner2017-02-031-1/+2
| | | | | | according to the graph at perf.haskell.org, it has regressed due to join points, which moved it very very close to the +10% mark and hence made it fail just sometimes.
* Get rid of ProbOneShotJoachim Breitner2017-02-035-38/+11
| | | | | | | This fixes #13227. It remains to be seen what the performance impacts are. Pushing as a branch to get perf.haskell.org answer that for us. Differential Revision: https://phabricator.haskell.org/D3067
* Ditch static flagsSylvain Henry2017-02-0251-610/+412
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the 4 lasting static flags (read from the command line and unsafely stored in immutable global variables) into dynamic flags. Most use cases have been converted into reading them from a DynFlags. In cases for which we don't have easy access to a DynFlags, we read from 'unsafeGlobalDynFlags' that is set at the beginning of each 'runGhc'. It's not perfect (not thread-safe) but it is still better as we can set/unset these 4 flags before each run when using GHC API. Updates haddock submodule. Rebased and finished by: bgamari Test Plan: validate Reviewers: goldfire, erikd, hvr, austin, simonmar, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2839 GHC Trac Issues: #8440
* users-guide: Explain behavior of verbose-core2core + dump-inliningsBen Gamari2017-02-021-1/+3
|
* Remove INLINE pragma on loopbreakerMatthew Pickering2017-02-021-1/+0
|
* Bump haskeline submoduleBen Gamari2017-02-021-0/+0
|
* Exhaustiveness check for EmptyCase (Trac #10746)George Karachalias2017-02-0226-19/+1128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Empty case expressions have strict semantics so the problem boils down to inhabitation checking for the type of the scrutinee. 3 main functions added: - pmTopNormaliseType_maybe for the normalisation of the scrutinee type - inhabitationCandidates for generating the possible patterns of the appropriate type - checkEmptyCase' to filter out the candidates that give rise to unsatisfiable constraints. See Note [Checking EmptyCase Expressions] in Check and Note [Type normalisation for EmptyCase] in FamInstEnv Test Plan: validate Reviewers: simonpj, goldfire, dfeuer, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2105 GHC Trac Issues: #10746
* Add a testcase for #13227Joachim Breitner2017-02-023-0/+12
| | | | where an expected float-out is not happening.
* Spelling fixesGabor Greif2017-02-0226-39/+39
|
* Add support for StaticPointers in GHCiBen Gamari2017-02-0225-53/+232
| | | | | | | | | | | | | | | | | | | | | Here we add support to GHCi for StaticPointers. This process begins by adding remote GHCi messages for adding entries to the static pointer table. We then collect binders needing SPT entries after linking and send the interpreter a message adding entries with the appropriate fingerprints. Test Plan: `make test TEST=StaticPtr` Reviewers: facundominguez, mboes, simonpj, simonmar, goldfire, austin, hvr, erikd Reviewed By: simonpj, simonmar Subscribers: RyanGlScott, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2504 GHC Trac Issues: #12356
* Make interface loading for COMPLETE pragmas lazyMatthew Pickering2017-02-011-2/+3
| | | | | | | | | | | | | | | | | Without this additional laziness we will loop forever trying to find the definitions of the conlikes referenced in the pragma. Fixes #13188 Reviewers: austin, RyanGlScott, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3058 GHC Trac Issues: #13188
* Introduce GHC.TypeNats module, change KnownNat evidence to be NaturalOleg Grenrus2017-02-0116-125/+302
| | | | | | | | | | | | Reviewers: dfeuer, austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3024 GHC Trac Issues: #13181
* Don't tick top-level string literalsBen Gamari2017-02-013-14/+33
| | | | | | | | | | | | | | | | | | | | | This fixes a regression due to D2605 (see #8472) wherein top-level primitive strings would fail to be noticed by CoreToStg as they were wrapped in a tick. This resulted in a panic in CoreToStg due to inconsistent CAF information (or a Core Lint failure, if enabled). Here we document the invariant that unlifted expressions can only sit at top-level if of the form `Lit (MachStr ...)` with no ticks or other embellishments. Moreover, we fix instance of this in `Simplify.prepareRhs` and `FloatOut.wrapTick` where this invariant was being broken. Test Plan: Validate with `-g`. Run testsuite with `WAY=ghci`. Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: simonpj, akio, scpmw, thomie Differential Revision: https://phabricator.haskell.org/D3051
* base: Derive Enum, Bounded for VecCount, VecElemBen Gamari2017-02-014-2/+18
| | | | | | | | | | | | Test Plan: Validate Reviewers: RyanGlScott, austin, hvr Reviewed By: RyanGlScott Subscribers: goldfire, RyanGlScott, thomie Differential Revision: https://phabricator.haskell.org/D3059
* Fix documentation NOTE about can_failVladislav Zavialov2017-02-011-1/+1
| | | | | In the note it is explained why it's fine to discard a can_fail primop, but the table erroneously says it's not fine.
* testsuite: Update allocations for T12234Ben Gamari2017-02-011-1/+2
| | | | This has been failing on Darwin since 748b79741652028827b6225c36b8ab55d22bdeb0.
* Join pointsLuke Maurer2017-02-0177-1151/+3969
| | | | | | | | | | | | | | | | | | | This major patch implements Join Points, as described in https://ghc.haskell.org/trac/ghc/wiki/SequentCore. You have to read that page, and especially the paper it links to, to understand what's going on; but it is very cool. It's Luke Maurer's work, but done in close collaboration with Simon PJ. This Phab is a squash-merge of wip/join-points branch of http://github.com/lukemaurer/ghc. There are many, many interdependent changes. Reviewers: goldfire, mpickering, bgamari, simonmar, dfeuer, austin Subscribers: simonpj, dfeuer, mpickering, Mikolaj, thomie Differential Revision: https://phabricator.haskell.org/D2853
* Remove very broad ignore. [ci skip]Tamar Christina2017-02-011-1/+0
| | | | | | | | | | | | Summary: `.gitignore` contains a very broad ignore entry for `foo*`. This has bitten us before and should probably be removed. Reviewers: bgamari, austin Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D3054
* Update output of failing 11223 testsTamar Christina2017-02-014-10/+10
| | | | | | | | | | | | | | Summary: make accept new test output Test Plan: make test TEST="T11223_link_order_a_b_2_fail T11223_simple_duplicate_lib" Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3053
* Typos in note header and testGabor Greif2017-02-013-3/+3
|
* Export callStackDocBen Gamari2017-01-311-1/+1
| | | | | | | | | | | | | | | | It's generally a pretty useful thing to have around. [skip ci] Test Plan: Build it Reviewers: austin, dfeuer Reviewed By: dfeuer Subscribers: dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D3048
* user-guide: fix links and file names (fixes #13198)Takenobu Tani2017-01-312-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | There are some incorrect links and file names in GHC user's guide. * docs/users_guide/glasgow_exts.rst - GHC/Base.lhs - GHC/List.lhs * docs/users_guide/ffi-chap.rst - :base-ref:`Foreign` - :base-ref:`Control.Concurrent` I fixed them. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3035 GHC Trac Issues: #13198
* Abstract over the way eventlogs are flushedalexbiehl2017-01-319-85/+281
| | | | | | | | | | | | | | | | | | | | Currently eventlog data is always written to a file `progname.eventlog`. This patch introduces the `flushEventLog` field in `RtsConfig` which allows to customize the writing of eventlog data. One possible scenario is the ongoing live-profile-monitor effort by @NCrashed which slurps all eventlog data through `fluchEventLog`. `flushEventLog` takes a buffer with eventlog data and its size and returns `false` (0) in case eventlog data could not be procesed. Reviewers: simonmar, austin, erikd, bgamari Reviewed By: simonmar, bgamari Subscribers: qnikst, thomie, NCrashed Differential Revision: https://phabricator.haskell.org/D2934
* FloatOut: Allow floating through breakpoint ticksBen Gamari2017-01-312-15/+15
| | | | | | | | | | | | | | | | | | I believe this is actually a completely valid thing to do, despite the arguments put forth in #10052. All that was missing was logic in SetLevels to correctly substitute the cloned binders into the breakpoint's free variable list. This is a prerequisite for enabling StaticPointer support in the interpreter. Test Plan: Validate Reviewers: austin, scpmw Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3049
* README: Mention acceptability of pull requestsBen Gamari2017-01-311-2/+1
|
* users guide: Fix markup of COMPLETE pragma examplesBen Gamari2017-01-311-24/+21
|
* Mark reallyUnsafePtrEquality# as can_failDavid Feuer2017-01-311-0/+35
| | | | | | | | | | | | | | | | | As described in the note, floating `reallyUnsafePtrEquality#` out can make it much less precise. Marking it `can_fail` will prevent it from floating out, which I believe is particularly important in light of 5a9a1738023aeb742e537fb4a59c4aa8fecc1f8a, and should also help prevent let/app invariant failures as seen in #11444 and #13027. Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2987 GHC Trac Issues: #13027, #11444
* Use top-level instances to solve superclasses where possibleDaniel Haraj2017-01-3110-19/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new flag `-fsolve-constant-dicts` which makes the constraint solver solve super class constraints with available dictionaries if possible. The flag is enabled by `-O1`. The motivation of this patch is that the compiler can produce more efficient code if the constraint solver used top-level instance declarations to solve constraints that are currently solved givens and their superclasses. In particular, as it currently stands, the compiler imposes a performance penalty on the common use-case where superclasses are bundled together for user convenience. The performance penalty applies to constraint synonyms as well. This example illustrates the issue: ``` {-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, FlexibleContexts #-} module B where class M a b where m :: a -> b type C a b = (Num a, M a b) f :: C Int b => b -> Int -> Int f _ x = x + 1 ``` Output without the patch, notice that we get the instance for `Num Int` by using the class selector `p1`. ``` f :: forall b_arz. C Int b_arz => b_arz -> Int -> Int f = \ (@ b_a1EB) ($d(%,%)_a1EC :: C Int b_a1EB) _ (eta1_B1 :: Int) -> + @ Int (GHC.Classes.$p1(%,%) @ (Num Int) @ (M Int b_a1EB) $d(%,%)_a1EC) eta1_B1 B.f1 ``` Output with the patch, nicely optimised code! ``` f :: forall b. C Int b => b -> Int -> Int f = \ (@ b) _ _ (x_azg :: Int) -> case x_azg of { GHC.Types.I# x1_a1DP -> GHC.Types.I# (GHC.Prim.+# x1_a1DP 1#) } ``` Reviewers: simonpj, bgamari, austin Reviewed By: simonpj Subscribers: mpickering, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D2714 GHC Trac Issues: #12791, #5835
* Fix binary instance for SrcStrictnessalexbiehl2017-01-311-1/+1
| | | | | | | | | | | | | | Summary: Found while revisiting the binary serialization for interface files. Test Plan: Building and validating currently Reviewers: austin, bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D3050
* Turn libraries/integer-gmp/gmp/tarball into a submoduleReid Barton2017-01-309-1727/+92
| | | | | | | | | | | | | | | | | | | | | | | | | The submodule repository contains the latest version of the GMP source distribution (6.1.2) with the doc/ subdirectory removed, as described in gmp/ghc.mk. Rather than applying the old patch from gmp/tarball/patch I moved its contents into gmp/gmpsrc.patch, canceling a patch related to memory management there. Experimentally, the PIC-related patch for OS X is still necessary. The upgrade to GMP 6.1.2 fixes #7655. Test Plan: Built on OS X with in-tree gmp and tested that the command `ghc -e 'length (show (2^(5*10^6) :: Integer))'` no longer segfaults. Reviewers: mpickering, hvr, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D3044 GHC Trac Issues: #7655
* Fix minor typo in README.mdTakenobu Tani2017-01-301-1/+1
| | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3040
* Fix links to building guides in MAKEHELP.mdTakenobu Tani2017-01-301-1/+3
| | | | | | | | | | | | | MAKEHELP.md has an old link to 'Building/Hacking'. I updated it to suitable links for new contributors. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3039
* Simplify minusInteger in integer-gmp slightlyReid Barton2017-01-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | These two special cases were created in D2278 by mechanically inlining negateInteger into plusInteger. They aren't needed (the `minusInteger (S# x#) (S# y#)` case already handles all values correctly), and they can never help by avoiding an allocation, unlike the original special case in plusInteger, since we still have to allocate the result. Removing these special cases will save a couple comparisons and conditional branches in the common case of subtracting two small Integers. Test Plan: Existing test `plusMinusInteger` already tests the values in question. Reviewers: bgamari, goldfire, austin, hvr Reviewed By: bgamari, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3034
* Print COMPLETE pragmas in --show-ifaceMatthew Pickering2017-01-302-0/+5
| | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3032
* Slighly clean up symbol loading error.Tamar Christina2017-01-302-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symbol not found error that is triggered during lazy-loading was a bit chaotic before. This reformats it a bit to: ``` ghc-stage2.exe: | E:\...\libLLVMSupport.a: unknown symbol `_ZN4llvm5APIntC1Ejyb' ghc-stage2.exe: | E:\...\libLLVMCore.a: unknown symbol `_ZN4llvm5APInt14AssignSlowCaseERKS0_' ghc-stage2.exe: | E:\...\libLLVMCore.a: unknown symbol `_ZN4llvm13ConstantRangeC1ENS_5APIntES1_' ghc-stage2.exe: | E:\...\libLLVMCore.a: unknown symbol `_ZN4llvm14FoldingSetImplC2Ej' ghc-stage2.exe: | E:\...\libLLVMCore.a: unknown symbol `_ZN4llvm15LLVMContextImplD1Ev' ghc-stage2.exe: | E:\...\libLLVMLTO.a: unknown symbol `_ZN4llvm11LLVMContextD1Ev' ghc-stage2.exe: | E:\...\libLLVMCore.a: unknown symbol `_ZNK4llvm5Value10getContextEv' ghc-stage2.exe: ^^ Could not load 'LLVMIsMultithreaded', dependency unresolved. See top entry above. ``` I have also thought about also showing the demangled names, as it may be useful for the end user. `libgcc` seems to provide a method for this so we wouldn't need any extra dependency. Any thoughts on this or would it not be useful? Reviewers: austin, erikd, simonmar, bgamari Reviewed By: bgamari Subscribers: RyanGlScott, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3027 GHC Trac Issues: #13093, #13113