- Oct 15, 2018
-
-
Unfortunately the implementation has confused the ability to make dynamic libraries with dynamic way. This constraint is only true for systems that require `-fPIC` for shared libraries. Since the implementation has this implicit assumption, mark the tests as requiring dynway. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: simonpj, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5174
-
Summary: The behavior previously enabled by this flag is as been the default since 8.6.1. Reviewers: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5193
-
Summary: This is part 1 from #14880: factor out a worker for the tyCoVarsOf... family of function, implementing them in terms of VarSet, but with accumulator-style (like in `FV`) built in, and with the same kind of pre-insert lookup; this has shown to perform better than either FV or plain VarSet in this particular scenario. Original notes from simonpj: In TyCoRep we now have tyCoVarsOfType implemented 1) Using FV -- this is the baseline version in GHC today 2) Using VarSets via unionVarSet 3) Using VarSets in accumulator-style In this patch (3) is enabled. When compiling perf/compiler/T5631 we get Compiler allocs (1) 1,144M (2) 1,175M (3) 1,142M The key new insight in (3) is this: ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc <---- NB! | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) Notice the second line! If the variable is already in the accumulator, don't re-add it. This makes big difference. Without it, allocation is 1,169M or so. One cause is that we only take the free vars of its kind once; that problem will go away when we do the main part of #14088 and close over kinds /afterwards/. But still, another cause is perhaps that every insert into a set overwrites the previous item, and so allocates a new path to the item; it's not a no-op even if the item is there already. Why use (3) rather than (1)? Becuase it just /has/ to be better; * FV carries around an InterestingVarFun, which does nothing useful here, but is tested at every variable * FV carries around a [Var] for the deterministic version. For this very hot operation (finding free vars) I think it makes sense to have speical purpose code. On the way I also simplified the (less used) coVarsOfType/Co family to use FV, by making serious use of the InterestingVarFun! Test Plan: validate, nofib Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14880 Differential Revision: https://phabricator.haskell.org/D5141
-
Summary: We were adding a `Sym` to one argument in the `InstCo` case of `optCoercion` but not another, leading to the two arguments to misaligned when combined via `Trans`. This fixes the issue with a well targeted use of `wrapSym`. Test Plan: make test TEST=T15725 Reviewers: goldfire, ningning, bgamari Reviewed By: goldfire, ningning Subscribers: rwbarton, carter GHC Trac Issues: #15725 Differential Revision: https://phabricator.haskell.org/D5217
-
- Oct 14, 2018
-
-
Summary: Trac #9279 reminded us that the worker wrapper transformation copes really badly with absent unlifted boxed bindings. As `Note [Absent errors]` in WwLib.hs points out, we can't just use `absentError` for unlifted bindings because there is no bottom to hide the error in. So instead, we synthesise a new `RubbishLit` of type `forall (a :: TYPE 'UnliftedRep). a`, which code-gen may subsitute for any boxed value. We choose `()`, so that there is a good chance that the program crashes instead instead of leading to corrupt data, should absence analysis have been too optimistic (#11126). Reviewers: simonpj, hvr, goldfire, bgamari, simonmar Reviewed By: simonpj Subscribers: osa1, rwbarton, carter GHC Trac Issues: #15627, #9279, #4306, #11126 Differential Revision: https://phabricator.haskell.org/D5153
-
Summary: This tracing may cause a security issue as some external tools out there expects user to set credentials in environment variables. Reviewers: bgamari, erikd, simonmar, monoidal Reviewed By: monoidal Subscribers: tdammers, rwbarton, carter GHC Trac Issues: #15371 Differential Revision: https://phabricator.haskell.org/D5187
- Oct 12, 2018
-
-
Ömer Sinan Ağacan authored
-
According to the deprecation schedule in the accepted proposal, the first step is to include `-fwarn-star-is-type` in `-Wcompat`. Test Plan: Validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15476 Differential Revision: https://phabricator.haskell.org/D5044
-
Simon Peyton Jones authored
-
- Oct 11, 2018
-
-
Piyush P. Kurur authored
This commit allows backpack signatures to enforce constraints like KnownNat on data types. Thus it fixes #15379. There were two important differences in the way GHC used to handle classes like KnowNat 1. Hand crafted instances of `KnownNat` were forbidden, and 2. The dictionary for an instance `KnownNat T` was generated on the fly. For supporting backpack both these points have to be revisited. Disallowing instances of KnownNat -------------------------------------------- Users were disallowed to declare instances of certain builtin classes like KnownNat for obvious safety reasons --- when we use the constraint like `KnownNat T`, we want T to be associated to a natural number. However, due to the reuse of this code while processing backpack signatures, `instance KnownNat T` were being disallowed even in module signature files. There is an important difference when it comes to instance declarations in a signature file. Consider the signature `Abstract` given below ``` signature Abstract where data T :: Nat instance KnownNat T ``` Inside a signature like `Abstract`, the `instance Known T` is not really creating an instance but rather demanding any module that implements this signature to enforce the constraint `KnownNat` on its type T. While hand crafted KnownNat instances continued to be prohibited in modules, this commit ensures that it is not forbidden while handling signatures. Resolving Dictionaries ---------------------------- Normally GHC expects any instance `T` of class `KnownNat` to eventually resolve to an integer and hence used to generate the evidence/dictionary for such instances on the fly as in when it is required. However, when backpack module and signatures are involved It is not always possible to resolve the type to a concrete integer utill the mixin stage. To illustrate consider again the signature `Abstract` > signature Abstract where > data T :: Nat > instance KnownNat T and a module `Util` that depends on it: > module Util where > import Abstract > printT :: IO () > printT = do print $ natVal (Proxy :: Proxy T) Clearly, we need to "use" the dictionary associated with `KnownNat T` in the module `Util`, but it is too early for the compiler to produce a real dictionary as we still have not fixed what `T` is. Only when we mixin a concrete module > module Concrete where > type T = 42 do we really get hold of the underlying integer. In this commit, we make the following changes in the resolution of instance dictionary for constraints like `KnownNat T` 1. If T is indeed available as a type alias for an integer constant, generate the dictionary on the fly as before, failing which 2. Do not give up as before but look up the type class environment for the evidence. This was enough to make the resolution of `KnownNat` dictionaries work in the setting of Backpack as when actual code is generated, the signature Abstract (due to the `import Abstract` ) in `Util` gets replaced by an actual module like Concrete, and resolution happens as before. Everything that we said for `KnownNat` is applicable for `KnownSymbol` as well. Reviewers: bgamari, ezyang, goldfire, simonpj Reviewed By: simonpj Subscribers: simonpj, ezyang, rwbarton, thomie, carter GHC Trac Issues: #15379 Differential Revision: https://phabricator.haskell.org/D4988
-
- Oct 10, 2018
-
-
Ömer Sinan Ağacan authored
(This change was accidentally reverted with the previous commit)
-
Ömer Sinan Ağacan authored
See #15696 for more details. We now always enter dataToTag# argument (done in generated Cmm, in StgCmmExpr). Any high-level optimisations on dataToTag# applications are done by the simplifier. Looking at tag bits (instead of reading the info table) for small types is left to another diff. Incorrect test T14626 is removed. We no longer do this optimisation (see comment:44, comment:45, comment:60). Comments and notes about special cases around dataToTag# are removed. We no longer have any special cases around it in Core. Other changes related to evaluating primops (seq# and dataToTag#) will be pursued in follow-up diffs. Test Plan: Validates with three regression tests Reviewers: simonpj, simonmar, hvr, bgamari, dfeuer Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15696 Differential Revision: https://phabricator.haskell.org/D5201
-
- Oct 09, 2018
-
-
Ben Gamari authored
This unfortunately broke i386 support since it introduced references to byte-sized registers that don't exist on that architecture. Reverts binary submodule This reverts commit 5d5307f9.
-
Alp Mestanogullari authored
This perf test is regularly failing (e.g with a deviation of 5.1% on a recent harbormaster build), this patch addresses the failure. Test Plan: TEST=haddock.base ./validate Reviewers: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5215
-
- Oct 07, 2018
-
-
This is the first step of implementing: https://github.com/ghc-proposals/ghc-proposals/pull/74 The main highlights/changes: - `primops.txt.pp` gets two new sections for two new primitive types for signed and unsigned 8-bit integers (`Int8#` and `Word8` respectively) along with basic arithmetic and comparison operations. `PrimRep`/`RuntimeRep` get two new constructors for them. All of the primops translate into the existing `MachOP`s. - For `CmmCall`s the codegen will now zero-extend the values at call site (so that they can be moved to the right register) and then truncate them back their original width. - x86 native codegen needed some updates, since it wasn't able to deal with the new widths, but all the changes are quite localized. LLVM backend seems to just work. Bumps binary submodule. Signed-off-by:
Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate with new tests Reviewers: hvr, goldfire, bgamari, simonmar Subscribers: Abhiroop, dfeuer, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4475
-
Sergei Trofimovich authored
T11760 needs multicore support from RTS: T11760: unknown RTS option: -N2 Signed-off-by:
Sergei Trofimovich <slyfox@gentoo.org>
-
Sergei Trofimovich authored
"ghc: setNumCapabilities: not supported on this platform" is caused by use of 'setNumCapabilities' in test itself. Signed-off-by:
Sergei Trofimovich <slyfox@gentoo.org>
-
Sergei Trofimovich authored
T10017 needs multicore support from RTS: T10017: unknown RTS option: -N2 Signed-off-by:
Sergei Trofimovich <slyfox@gentoo.org>
-
Sergei Trofimovich authored
"ghc: setNumCapabilities: not supported on this platform" is caused by use of 'ghc --make -j2' in build rule. Signed-off-by:
Sergei Trofimovich <slyfox@gentoo.org>
-
- Oct 06, 2018
-
-
Sergei Trofimovich authored
commit 64c54fff ("Mark system and internal symbols as private symbols in asm") Added `internalNamePrefix` helper. Unfortunately it generates invalid label in unregisterised mode: ``` $ ./configure --enable-unregisterised /tmp/ghc19372_0/ghc_4.hc:2831:22: error: error: expected identifier or '(' before '.' token static const StgWord .Lcl3_info[]__attribute__((aligned(8)))= { ^ ``` Here asm-style prefix is applied to C symbol. The fix is simple: apply asm-style labels only to assembly code. Signed-off-by:
Sergei Trofimovich <slyfox@gentoo.org> Reviewers: simonmar, last_g, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5207
-
Ömer Sinan Ağacan authored
Write barriers for large array writes were added in D2525, as a part of #12469. However it seems we forgot about small arrays. This patch adds the same write barrier to small array writes. Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #12469 Differential Revision: https://phabricator.haskell.org/D5209
-
- Oct 05, 2018
-
-
David Feuer authored
Make the `StableName#` parameter phantom: There is actually never any reason to care about the type of the underlying object of a `StableName#`. The underlying object type shouldn't really even *be* a parameter. But at least we can mark it as phantom. Reviewers: hvr, bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: ekmett, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5117
-
Krzysztof Gogolewski authored
Test Plan: validate Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14391 Differential Revision: https://phabricator.haskell.org/D5135
-
Fix some various issues that popped up because the linker now doesn't load import libraries for longer than it needs to. These are all use after free issues. Test Plan: ./validate Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: simonpj, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5175
-
Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5176
-
- 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 Reviewed By: angerman Subscribers: rwbarton, carter GHC Trac Issues: #13904, #14251 Differential Revision: https://phabricator.haskell.org/D5190
-
The -Wstar-is-type flag was added without documentation. Now it has documentation. Test Plan: Validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5203
-
This test is remarkably flaky, failing regularly on i386/Linux, amd64/Fedora, and amd64/Darwin. I've opened #15383 to track this and am disabling the test for now until we have a chance to investigate. Test Plan: Validate Reviewers: alpmestan Subscribers: rwbarton, carter GHC Trac Issues: #15383 Differential Revision: https://phabricator.haskell.org/D5202
-
Ben Gamari authored
-
- Oct 04, 2018
-
-
Ryan Scott authored
In commit 2f09753f, some internal comments about the kind signature of the HasField class accidentially leaked into its publicly exported Haddocks.
-
Summary: This simply makes explicit what is already the case. Due to special treatment in the parser, `->` has the lowest fixity. This patch propagates that information to: * GHCi, where `:info ->` now return the right fixity * TH, where `reifyFixity` returns the right fixity * the generated sources for `GHC.Prim` See #15235. Test Plan: make test Reviewers: bgamari, alanz, RyanGlScott Reviewed By: RyanGlScott Subscribers: int-index, RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15235 Differential Revision: https://phabricator.haskell.org/D5199
-
Summary: When converting from TH AST back to HsType, we were occasionally dropping type arguments. This resulted in incorrectly accepted programs as well as incorrectly rejected programs. Test Plan: make TEST=T15360a && make TEST=T15360b Reviewers: goldfire, bgamari, tdammers Reviewed By: bgamari, tdammers Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15360 Differential Revision: https://phabricator.haskell.org/D5188
-
Summary: This allows for things like `[t :: MyKind]`, `(a :: k, b)`, and so on. Test Plan: make TEST=T11622 && make TEST=T8708 Reviewers: RyanGlScott, bgamari, simonpj, goldfire, alanz Reviewed By: RyanGlScott, simonpj Subscribers: alanz, simonpj, rwbarton, mpickering, carter GHC Trac Issues: #11622, #8708 Differential Revision: https://phabricator.haskell.org/D5173
-
Summary: * Clarify the non-presence of derived classes in reified decls (#15167) * Clarify the shallowness of "reifyInstances" (#7066) * Mention that 'Typeable' instances are not found by reifyInstances (#11251) * Various Haddock markup issues fixed Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15167, #7066, #11251 Differential Revision: https://phabricator.haskell.org/D5197
-
Summary: * Extended `genprimcode` to generate Haddock-compatible deprecations, as well as displaying information about which functions are LLVM-only and which functions can fail with an unchecked exception. * Ported existing deprecations to the new format, and also added a deprecation on `par#` (see Trac #15227). * Emit an error on fixity/deprecation of builtins, unless we are processing the module in which that name is defined (see Trac #15233). That means the following is no longer accepted (outside of `GHC.Types`): ``` infixr 7 : {-# DEPRECATED (:) "cons is deprecated" #-} ``` * Generate `data (->) a b` with docs and fixity in `GHC.Prim`. This means: GHC can now parse `data (->) a b` and `infixr 0 ->` (only in `GHC.Prim`) and `genprimcode` can digest `primtype (->) a b` (See Trac #4861) as well as some misc fixes along the way. Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15227, #15233, #4861 Differential Revision: https://phabricator.haskell.org/D5167
-
Summary: Also qualified some identifier hyperlinks along the way. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #4861 Differential Revision: https://phabricator.haskell.org/D5158
-