summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* EPA: Tidy up some GHC.Parser.Annotation commentswip/az/exactprint-tweak-parser-state-commentGHC GitLab CI2021-03-251-14/+33
| | | | | | This is a follow up from !2418 / #19579 [skip ci]
* EPA : Remove ApiAnn from ParsedModuleGHC GitLab CI2021-03-2529-1438/+202
| | | | | All the comments are now captured in the AST, there is no need for a side-channel structure for them.
* Add compiler linting to CIHécate2021-03-2532-155/+149
| | | | | This commit adds the `lint:compiler` Hadrian target to the CI runner. It does also fixes hints in the compiler/ and libraries/base/ codebases.
* Fix the binder-swap transformation in OccurAnalSimon Peyton Jones2021-03-245-53/+234
| | | | | | | | | | The binder-swap transformation needs to be iterated, as shown by #19581. The fix is pretty simple, and is explained in point (BS2) of Note [The binder-swap substitution]. Net effect: - sometimes, fewer simplifier iterations - sometimes, more case merging
* hadrian: remove alex and happy from build-toolsAdam Sandberg Ericsson2021-03-241-2/+0
| | | | | | | | | Hadrian doesn't actually depend on them as built-tools and normal usage where you want to compile GHC will pick up the tools before you run hadrian via the ./configure script. Not building an extra copy of alex and happy might also improve overall build-times when building from scratch.
* STG AST - Make ConstructorNumber always a field.Andreas Klebinger2021-03-243-11/+5
| | | | | | | | It's used by all passes and already used as a regular field. So I figured it would be both more consistent and performant to make it a regular field for all constructors. I also added a few bangs in the process.
* CmmToAsm.Reg.Linear: oneShot-ify RegMwip/ncg-perfBen Gamari2021-03-241-16/+22
| | | | | | | | | | | | | ------------------------- Metric Decrease: T783 T4801 T12707 T13379 T3294 T4801 T5321FD -------------------------
* CmmToAsm.Reg.Linear: Use concat rather than repeated (++)Ben Gamari2021-03-241-2/+1
|
* EPA: Run exactprint transformation tests as part of CIGHC GitLab CI2021-03-2385-1211/+1289
| | | | | | | | | | EPA == exact print annotations. When !2418 landed, it did not run the tests brought over from ghc-exactprint for making sure the AST prints correctly efter being edited. This enables those tests.
* gitlab-ci: Rework handling of head.hackage job triggerBen Gamari2021-03-232-88/+9
| | | | | | | | GitLab 12.3 now has reasonable support [1] for cross-project job dependencies, allowing us to drop the awful hack of a shell script we used previously. [1] https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#mirroring-status-from-triggered-pipeline
* Move loader state into InterpSylvain Henry2021-03-2321-579/+649
| | | | | | | | | | | | | | | | | | The loader state was stored into HscEnv. As we need to have two interpreters and one loader state per interpreter in #14335, it's natural to make the loader state a field of the Interp type. As a side effect, many functions now only require a Interp parameter instead of HscEnv. Sadly we can't fully free GHC.Linker.Loader of HscEnv yet because the loader is initialised lazily from the HscEnv the first time it is used. This is left as future work. HscEnv may not contain an Interp value (i.e. hsc_interp :: Maybe Interp). So a side effect of the previous side effect is that callers of the modified functions now have to provide an Interp. It is satisfying as it pushes upstream the handling of the case where HscEnv doesn't contain an Interpreter. It is better than raising a panic (less partial functions, "parse, don't validate", etc.).
* rts: Use long-path-aware statBen Gamari2021-03-233-4/+11
| | | | | | | | Previously `pathstat` relied on msvcrt's `stat` implementation, which was not long-path-aware. It should rather be defined in terms of the `stat` implementation provided by `utils/fs`. Fixes #19541.
* PPC NCG: Fix int to float conversionPeter Trommler2021-03-231-6/+26
| | | | | | | | In commit 540fa6b2 integer to float conversions were changed to round to the nearest even. Implement a special case for 64 bit integer to single precision floating point numbers. Fixes #19563.
* More improvement to MonoLocalBinds documentationSimon Peyton Jones2021-03-231-50/+35
|
* UniqSM: oneShot-ifyBen Gamari2021-03-221-10/+21
| | | | | | | | | | Part of #18202 ------------------------- Metric Decrease: T12707 T3294 -------------------------
* Short-circuit warning generation for partial type signaturesSimon Peyton Jones2021-03-221-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | This Note says it all: Note [Skip type holes rapidly] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we have module with a /lot/ of partial type signatures, and we compile it while suppressing partial-type-signature warnings. Then we don't want to spend ages constructing error messages and lists of relevant bindings that we never display! This happened in #14766, in which partial type signatures in a Happy-generated parser cause a huge increase in compile time. The function ignoreThisHole short-circuits the error/warning generation machinery, in cases where it is definitely going to be a no-op. It makes a pretty big difference on the Sigs.hs example in #14766: Compile-time allocation GHC 8.10 5.6G Before this patch 937G With this patch 4.7G Yes, that's more than two orders of magnitude!
* base: Use mutableByteArrayContentsBen Gamari2021-03-223-13/+11
|
* compiler: Introduce mutableByteArrayContents# primopBen Gamari2021-03-222-0/+8
| | | | | As noted in #19540, a number of users within and outside of GHC rely on unsafeCoerceUnlifted to work around the fact that this was missing
* [ci] Default values for GITLAB_CI_BRANCH, and IGNORE_PERF_FAILURESwip/angerman/9.2-forward-portsMoritz Angermann2021-03-211-3/+3
|
* [llvm/darwin] change vortex cpu to genericMoritz Angermann2021-03-211-1/+1
| | | | | For now only the apple flavoured llvm knows vortex, as we build against other toolchains, lets stay with generic for now.
* [elf/aarch64] Fall Through decorationMoritz Angermann2021-03-211-4/+4
|
* [ci/arm/darwin/testsuite] Forwards ports from GHC-8.10Moritz Angermann2021-03-2114-64/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a set of forward ports (cherry-picks) from 8.10 - a7d22795ed [ci] Add support for building on aarch64-darwin - 5109e87e13 [testlib/driver] denoise - 307d34945b [ci] default value for CONFIGURE_ARGS - 10a18cb4e0 [testsuite] mark ghci056 as fragile - 16c13d5acf [ci] Default value for MAKE_ARGS - ab571457b9 [ci/build] Copy config.sub around - 251892b98f [ci/darwin] bump nixpkgs rev - 5a6c36ecb4 [testsuite/darwin] fix conc059 - aae95ef0c9 [ci] add timing info - 3592d1104c [Aarch64] No div-by-zero; disable test. - 57671071ad [Darwin] mark stdc++ tests as broken - 33c4d49754 [testsuite] filter out superfluous dylib warnings - 4bea83afec [ci/nix-shell] Add Foundation and Security - 6345530062 [testsuite/json2] Fix failure with LLVM backends - c3944bc89d [ci/nix-shell] [Darwin] Stop the ld warnings about libiconv. - b821fcc714 [testsuite] static001 is not broken anymore. - f7062e1b0c [testsuite/arm64] fix section_alignment - 820b076698 [darwin] stop the DYLD_LIBRARY_PATH madness - 07b1af0362 [ci/nix-shell] uniquify NIX_LDFLAGS{_FOR_TARGET} As well as a few additional fixups needed to make this block compile: - Fixup all.T - Set CROSS_TARGET, BROKEN_TESTS, XZ, RUNTEST_ARGS, default value. - [ci] shell.nix bump happy
* Remove unnecessary extendTyVarEnvFVRn functionRyan Scott2021-03-213-11/+6
| | | | | | | | | | | The `extendTyVarEnvFVRn` function does the exact same thing as `bindLocalNamesFV`. I see no meaningful distinction between the two functions, so let's just remove the former (which is only used in a handful of places) in favor of the latter. Historical note: `extendTyVarEnvFVRn` and `bindLocalNamesFV` used to be distinct functions, but their implementations were synchronized in 2004 as a part of commit 20e39e0e07e4a8e9395894b2785d6675e4e3e3b3.
* Bump template-haskell version to 2.18.0.0wip/T19083Ryan Scott2021-03-206-6/+6
| | | | | | | This requires bumping the `exceptions` and `text` submodules to bring in commits that bump their respective upper version bounds on `template-haskell`. Fixes #19083.
* Move miscategorized items in template-haskell changelogRyan Scott2021-03-201-6/+6
|
* Clean up TBDs in changelogBen Gamari2021-03-201-1/+7
| | | | (cherry picked from commit 4f334120c8e9cc4aefcbf11d99f169f648af9fde)
* gitlab-ci: Always start with fresh clonewip/ci-fixes-2Ben Gamari2021-03-201-0/+3
| | | | | Currently we are suffering from issues that appear to be caused by non-hermetic builds. Try avoiding this by setting `GIT_STRATEGY` to `clone`.
* Add error information to osCommitMemory on failure.Moritz Angermann2021-03-201-1/+1
|
* Remove outdated VagrantfileSebastian Graf2021-03-201-50/+0
|
* Add fold vs. mconcat test T17123Viktor Dukhovni2021-03-202-0/+14
|
* Fix fake import in GHC.Exception.Type boot moduleSylvain Henry2021-03-205-23/+22
| | | | | | | | | It seems like I imported "GHC.Types ()" thinking that it would transitively import GHC.Num.Integer when I wrote that module; but it doesn't. This led to build failures. See https://mail.haskell.org/pipermail/ghc-devs/2021-March/019641.html
* Fix literals for unregisterized backend of small typesJohn Ericson2021-03-201-5/+16
| | | | | | | | | | | | | | | | | | | | | | All credit to @hsyl20, who in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4717#note_338560 figured out this was a problem. To fix this, we use casts in addition to the shrinking and suffixing that is already done. It might make for more verbose code, I don't think that matters too much. In the future, perhaps some of the shrinking and suffixing can be removed for being redundant. That proved less trivial than it sounds, so this wasn't done at this time. Progress towards #19026 Metric Increase: T12707 T13379 Co-authored-by: Sylvain Henry <hsyl20@gmail.com>
* Add more boundary checks for `rem` and `mod`John Ericson2021-03-201-18/+44
| | | | | | | | | | | | | | | | | It's quite backend-dependent whether we will actually handle that case right, so let's just always do this as a precaution. In particular, once we replace the native primops used here with the new sized primops, the 16-bit ones on x86 will begin to use 16-bit sized instructions where they didn't before. Though I'm not sure of any arch which has 8-bit scalar instructions, I also did those for consistency. Plus, there are *vector* 8-bit ops in the wild, so if we ever got into autovectorization or something maybe it's prudent to put this here as a reminder not to forget about catching overflows. Progress towards #19026
* Fix an levity-polymorphism errorSimon Peyton Jones2021-03-204-89/+107
| | | | | | | | As #19522 points out, we did not account for visible type application when trying to reject naked levity-polymorphic functions that have no binding. This patch tidies up the code, and fixes the bug too.
* Add compiler perf regression test for #9198Simon Jakobi2021-03-202-0/+16
|
* Nested CPR light (#19398)Sebastian Graf2021-03-2028-508/+705
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While fixing #19232, it became increasingly clear that the vestigial hack described in `Note [Optimistic field binder CPR]` is complicated and causes reboxing. Rather than make the hack worse, this patch gets rid of it completely in favor of giving deeply unboxed parameters the Nested CPR property. Example: ```hs f :: (Int, Int) -> Int f p = case p of (x, y) | x == y = x | otherwise = y ``` Based on `p`'s `idDemandInfo` `1P(1P(L),1P(L))`, we can see that both fields of `p` will be available unboxed. As a result, we give `p` the nested CPR property `1(1,1)`. When analysing the `case`, the field CPRs are transferred to the binders `x` and `y`, respectively, so that we ultimately give `f` the CPR property. I took the liberty to do a bit of refactoring: - I renamed `CprResult` ("Constructed product result result") to plain `Cpr`. - I Introduced `FlatConCpr` in addition to (now nested) `ConCpr` and and according pattern synonym that rewrites flat `ConCpr` to `FlatConCpr`s, purely for compiler perf reasons. - Similarly for performance reasons, we now store binders with a Top signature in a separate `IntSet`, see `Note [Efficient Top sigs in SigEnv]`. - I moved a bit of stuff around in `GHC.Core.Opt.WorkWrap.Utils` and introduced `UnboxingDecision` to replace the `Maybe DataConPatContext` type we used to return from `wantToUnbox`. - Since the `Outputable Cpr` instance changed anyway, I removed the leading `m` which we used to emit for `ConCpr`. It's just noise, especially now that we may output nested CPRs. Fixes #19398.
* Make the simplifier slightly stricter.Andreas Klebinger2021-03-205-49/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reduces allocations by the simplifier by 3% for the Cabal test at -O2. We do this by making a few select fields, bindings and arguments strict which reduces allocations for the simplifier by around 3% in total for the Cabal test. Which is about 2% fewer allocations in total at -O2. ------------------------- Metric Decrease: T18698a T18698b T9233 T9675 T9872a T9872b T9872c T9872d T10421 T12425 T13253 T5321FD T9961 -------------------------
* Generate GHCi bytecode from STG instead of Core and support unboxedLuite Stegeman2021-03-2032-632/+2177
| | | | | | tuples and sums. fixes #1257
* Transfer tickish things to GHC.Types.TickishLuite Stegeman2021-03-2052-340/+427
| | | | | Metric Increase: MultiLayerModules
* rename Tickish to CoreTickishLuite Stegeman2021-03-2026-59/+66
|
* remove superfluous 'id' type parameter from GenTickishLuite Stegeman2021-03-2030-80/+99
| | | | | The 'id' type is now determined by the pass, using the XTickishId type family.
* Save the type of breakpoints in the Breakpoint tick in STGLuite Stegeman2021-03-2023-55/+97
| | | | | | | | GHCi needs to know the types of all breakpoints, but it's not possible to get the exprType of any expression in STG. This is preparation for the upcoming change to make GHCi bytecode from STG instead of Core.
* testsuite: Normalise slashesGHC GitLab CI2021-03-202-2/+3
| | | | In the `comments` and `literals` tests, since they contain file paths.
* check-ppr,check-exact: Write out result as binaryGHC GitLab CI2021-03-202-8/+19
| | | | | | | | | | | Previously we would use `writeFile` to write the intermediate files to check for round-tripping. However, this will open the output handle as a text handle, which on Windows will change line endings. Avoid this by opening as binary. Explicitly use utf8 encoding. This is for tests only, do not need to worry about user compatibility.
* GHC Exactprint main commitAlan Zimmerman2021-03-20369-10092/+23718
| | | | | | | | Metric Increase: T10370 parsing001 Updates haddock submodule
* Add the main types to be used for exactprint in the GHC ASTAlan Zimmerman2021-03-201-64/+964
| | | | | | | | | | | | | | | The MR introducing the API Annotations, !2418 is huge. Conceptually it is two parts, the one deals with introducing the new types to be used for annotations, and outlining how they will be used. This is a small change, localised to compiler/GHC/Parser/Annotation.hs and is contained in this commit. The follow-up, larger commit deals with mechanically working this through the entire AST and updating all the parts affected by it. It is being split so the part that needs good review feedback can be seen in isolation, prior to the rest coming in.
* [skip ci] Fix 'Ord' documentation inconsistencyGaël Deest2021-03-201-4/+4
| | | | | | | | | | | | | | | | | | | Current documentation for the `Ord` typeclass is inconsistent. It simultaneously mentions that: > The 'Ord' class is used for totally ordered datatypes. And: > The Haskell Report defines no laws for 'Ord'. However, '<=' is > customarily expected to implement a non-strict partial order […] The Haskell report (both 98 and 2010 versions) mentions total ordering, which implicitly does define laws. Moreover, `compare :: Ord a => a -> a -> Ordering` and `data Ordering = LT | EQ | GT` imply that the order is indeed total (there is no way to say that two elements are not comparable). This MR fixes the Haddock comment, and adds a comparability law to the list of suggested properties.
* gitlab-ci: Ignore performance improvements in marge jobsBen Gamari2021-03-193-14/+29
| | | | | | | | Currently we have far too many merge failures due to cumulative performance improvements. Avoid this by accepting metric decreases in marge-bot jobs. Fixes #19562.
* testsuite: Make --ignore-perf-tests more expressiveBen Gamari2021-03-194-9/+22
| | | | Allow skipping of only increases/decreases.
* Built-in type families: CharToNat, NatToChar (#19535)Vladislav Zavialov2021-03-178-31/+191
| | | | | Co-authored-by: Daniel Rogozin <daniel.rogozin@serokell.io> Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io>