summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SpecConstr - Attach evaldUnfolding to known evaluated arguments.wip/andreask/spec_constrAndreas Klebinger2021-11-081-31/+153
|
* Pmc: Do inhabitation test for unlifted vars (#20631)Sebastian Graf2021-11-074-17/+56
| | | | | | | | | | | Although I thought we were already set to handle unlifted datatypes correctly, it appears we weren't. #20631 showed that it's wrong to assume `vi_bot=IsNotBot` for `VarInfo`s of unlifted types from their inception if we don't follow up with an inhabitation test to see if there are any habitable constructors left. We can't trigger the test from `emptyVarInfo`, so now we instead fail early in `addBotCt` for variables of unlifted types. Fixed #20631.
* Factor out unregisterised and tables next to code m4 macrosJohn Ericson2021-11-073-53/+69
| | | | These will be useful for upcoming RTS configure script.
* Print the Type kind qualified when ambiguous (#20627)Vladislav Zavialov2021-11-076-18/+83
| | | | | | | | | | | | | | | The Type kind is printed unqualified: ghci> :set -XNoStarIsType ghci> :k (->) (->) :: Type -> Type -> Type This is the desired behavior unless the user has defined their own Type: ghci> data Type Then we want to resolve the ambiguity by qualification: ghci> :k (->) (->) :: GHC.Types.Type -> GHC.Types.Type -> GHC.Types.Type
* Don't undersaturate join points through eta-reduction.Andreas Klebinger2021-11-072-2/+13
| | | | | | | | In #20599 I ran into an issue where the unfolding for a join point was eta-reduced removing the required lambdas. This patch adds guards that should prevent this from happening going forward.
* Refactor HdkM using deriving viaVladislav Zavialov2021-11-061-27/+14
| | | | | | * No more need for InlineHdkM, mkHdkM * unHdkM is now just a record selector * Update comments
* Add regression test for #20568Nikolay Yakimov2021-11-064-0/+31
| | | | GHC produced broken executables with rebindable if and -fhpc if `ifThenElse` expected non-Bool condition until GHC 9.0. This adds a simple regression test.
* Fix Int64/Word64's Enum instance fusionSylvain Henry2021-11-062-0/+28
| | | | | | | | Performance improvement: T15185(normal) run/alloc 51112.0 41032.0 -19.7% GOOD Metric Decrease: T15185
* Make Word64 use Word64# on every architectureSylvain Henry2021-11-0636-786/+201
|
* Remove target dependent CPP for Word64/Int64 (#11470)Sylvain Henry2021-11-0617-135/+154
| | | | | | | | | | | | | | | | | | | | | | | | | Primops types were dependent on the target word-size at *compiler* compilation time. It's an issue for multi-target as GHC may not have the correct primops types for the target. This patch fixes some primops types: if they take or return fixed 64-bit values they now always use `Int64#/Word64#`, even on 64-bit architectures (where they used `Int#/Word#` before). Users of these primops may now need to convert from Int64#/Word64# to Int#/Word# (a no-op at runtime). This is a stripped down version of !3658 which goes the all way of changing the underlying primitive types of Word64/Int64. This is left for future work. T12545 allocations increase ~4% on some CI platforms and decrease ~3% on AArch64. Metric Increase: T12545 Metric Decrease: T12545
* CI: allow perf-nofib to failSylvain Henry2021-11-061-2/+4
|
* Fix Int64ToInt/Word64ToWord rules on 32-bit architecturesSylvain Henry2021-11-062-16/+17
| | | | | | When the input literal was larger than 32-bit it would crash in a compiler with assertion enabled because it was creating an out-of-bound word-sized literal (32-bit).
* Add missing Int64/Word64 constant-folding rulesSylvain Henry2021-11-061-0/+16
|
* i386: fix codegen of 64-bit comparisonsSylvain Henry2021-11-061-14/+21
|
* Export `withTcPlugins` and `withHoleFitPlugins`Ziyang Liu2021-11-061-0/+2
|
* Fix boolean confusion with Opt_NoLlvmMangler flagMatthew Pickering2021-11-051-2/+2
| | | | | | | I accidently got the two branches of the if expression the wrong way around when refactoring. Fixes #20567
* Avoid GHC_STAGE and other include bitsJohn Ericson2021-11-0514-22/+33
| | | | | | | | | We should strive to make our includes in terms of the RTS as much as possible. One place there that is not possible, the llvm version, we make a new tiny header Stage numbers are somewhat arbitrary, if we simple need a newer RTS, we should say so.
* make: Futher systematize handling of generated headersJohn Ericson2021-11-053-26/+12
| | | | | This will make it easier to add and remove generated headers, as we will do when we add a configure script for the RTS.
* Allow CApi FFI calls in GHCiMatthew Pickering2021-11-055-1/+12
| | | | | | | | At some point in the past this started working. I noticed this when working on multiple home units and couldn't load GHC's dependencies into the interpreter. Fixes #7388
* Remove record field from SoloSimon Peyton Jones2021-11-057-41/+23
| | | | | | | | | | | | | | Ticket #20562 revealed that Solo, which is a wired-in TyCon, had a record field that wasn't being added to the type env. Why not? Because wired-in TyCons don't have record fields. It's not hard to change that, but it's tiresome for this one use-case, and it seems easier simply to make `getSolo` into a standalone function. On the way I refactored the handling of Solo slightly, to put it into wiredInTyCons (where it belongs) rather than only in knownKeyNames
* Fix deferOutOfScopeVariables for qualified #20472CarrieMY2021-11-054-10/+22
|
* Tiny renamings and doc updatesRichard Eisenberg2021-11-042-54/+55
| | | | Close #20433
* Correct load_load_barrier for risc-vTakenobu Tani2021-11-041-1/+1
| | | | | | | | | This patch corrects the instruction for load_load_barrier(). Current load_load_barrier() incorrectly uses `fence w,r`. It means a store-load barrier. See also linux-kernel's smp_rmb() implementation: https://github.com/torvalds/linux/blob/v5.14/arch/riscv/include/asm/barrier.h#L27
* ci: Don't run alpine job in fast-ciMatthew Pickering2021-11-041-0/+2
|
* Generalize the type of wrapLocSndMAVladislav Zavialov2021-11-031-4/+13
|
* hadrian: Use $bindir instead of `dirname $0` in ghci wrapperARATA Mizuki2021-11-031-2/+1
| | | | | | `dirname $0` doesn't work when the wrapper is called via a symbolic link. Fix #20589
* EPA: Get rid of bare SrcSpan's in the ParsedSourceAlan Zimmerman2021-11-0244-312/+408
| | | | | | | | | | | | | The ghc-exactPrint library has had to re-introduce the relatavise phase. This is needed if you change the length of an identifier and want the layout to be preserved afterwards. It is not possible to relatavise a bare SrcSpan, so introduce `SrcAnn NoEpAnns` for them instead. Updates haddock submodule.
* Fix #20590 with another application of mkHsContextMaybeRyan Scott2021-11-024-17/+28
| | | | | | | | | | | | | | We were always converting empty GADT contexts to `Just []` in `GHC.ThToHs`, which caused the pretty-printer to always print them as `() => ...`. This is easily fixed by using the `mkHsContextMaybe` function when converting GADT contexts so that empty contexts are turned to `Nothing`. This is in the same tradition established in commit 4c87a3d1d14f9e28c8aa0f6062e9c4201f469ad7. In the process of fixing this, I discovered that the `Cxt` argument to `mkHsContextMaybe` is completely unnecessary, as we can just as well check if the `LHsContext GhcPs` argument is empty. Fixes #20590.
* Treat generated RTS headers in a more consistent mannerJohn Ericson2021-11-025-10/+31
| | | | We can depend on all of them at once the same way.
* Remove `includes_GHCCONSTANTS` from make build systemJohn Ericson2021-11-022-3/+0
| | | | It is dead code.
* Separate some AC_SUBST / AC_DEFINEJohn Ericson2021-11-023-9/+10
| | | | | | | | Eventually, the RTS configure alone will need the vast majority of AC_DEFINE, and the top-level configure will need the most AC_SUBST. By removing the "side effects" of the macros like this we make them more reusable so they can be shared between the two configures without doing too much.
* HsToken for let/in (#19623)Vladislav Zavialov2021-11-0223-83/+97
| | | | One more step towards the new design of EPA.
* Update comment in Lint.hs Andreas Klebinger2021-11-011-1/+1
| | | mkWwArgs has been renamed to mkWorkerArgs.
* configure: Hide error output from --target checkBen Gamari2021-10-311-1/+1
|
* ghc: Bump Cabal-Version to 1.22Ben Gamari2021-10-311-1/+1
| | | | This is necessary to use reexported-modules
* Modularize autoconf platform detectionJohn Ericson2021-10-318-164/+200
| | | | | | | This will allow better reuse of it, such as in the upcoming RTS configure script. Progress towards #17191
* Make build system: Put make generated include's in RTS distdirsJohn Ericson2021-10-316-22/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are best thought of as being part of the RTS. - After !6791, `ghcautoconf.h` won't be used by the compiler inappropriately. - `ghcversion.h` is only used once outside the RTS, which is `compiler/cbits/genSym.c`. Except we *do* mean the RTS GHC is built against there, so it's better if we always get get the installed version. - `ghcplatform.h` alone is used extensively outside the RTS, but since we no longer have a target platform it is perfectly safe/correct to get the info from the previous RTS. All 3 are exported from the RTS currently and in the bootstrap window. This commit just swaps directories around, such that the new headers may continue to be used in stage 0 despite the reasoning above, but the idea is that we can subsequently make more interesting changes doubling down on the reasoning above. In particular, in !6803 we'll start "morally" moving `ghcautonconf.h` over, introducing an RTS configure script and temporary header of its `AC_DEFINE`s until the top-level configure script doesn't define any more. Progress towards #17191
* ghci: Make getModBreaks robust against DotO UnlinkedBen Gamari2021-10-301-1/+6
| | | | | | | | Previously getModBreaks assumed that an interpreted linkable will have only a single `BCOs` `Unlinked` entry. However, in general an object may also contain `DotO`s; ignore these. Fixes #20570.
* User's guide: data family kind-inference changessheaf2021-10-291-3/+12
| | | | | | | | Explain that the kind of a data family instance must now be fully determined by the header of the instance, and how one might migrate code to account for this change. Fixes #20527
* Bignum: add missing ruleSylvain Henry2021-10-292-17/+14
| | | | Add missing "Natural -> Integer -> Word#" rule.
* Add test for T15547 (#15547)Sylvain Henry2021-10-293-0/+74
| | | | Fix #15547
* make build system: RTS should use dist-install not distJohn Ericson2021-10-298-88/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the following find and replace: - `rts/dist` -> `rts/dist-install` # for paths - `rts_dist` -> `rts_dist-install` # for make rules and vars - `,dist` -> `,dist-install` # for make, just in rts/ghc.mk` Why do this? Does it matter when the RTS is just built once? The answer is, yes, I think it does, because I want the distdir--stage correspondence to be consistent. In particular, for #17191 and continuing from d5de970dafd5876ef30601697576167f56b9c132 I am going to make the headers (`rts/includes`) increasingly the responsibility of the RTS (hence their new location). However, those headers are current made for multiple stages. This will probably become unnecessary as work on #17191 progresses and the compiler proper becomes more of a freestanding cabal package (e.g. a library that can be downloaded from Hackage and built without any autoconf). However, until that is finished, we have will transitional period where the RTS and headers need to agree on dirs for multiple stages. I know the make build system is going away, but it's not going yet, so I need to change it to unblock things :).
* WorkWrap: Update Unfolding with WW'd body prior to `tryWW` (#20510)Sebastian Graf2021-10-297-95/+234
| | | | | | | | | | | | | | | | | | | | We have a function in #20510 that is small enough to get a stable unfolding in WW: ```hs small :: Int -> Int small x = go 0 x where go z 0 = z * x go z y = go (z+y) (y-1) ``` But it appears we failed to use the WW'd RHS as the stable unfolding. As a result, inlining `small` would expose the non-WW'd version of `go`. That appears to regress badly in #19727 which is a bit too large to extract a reproducer from that is guaranteed to reproduce across GHC versions. The solution is to simply update the unfolding in `certainlyWillInline` with the WW'd RHS. Fixes #20510.
* Add more INLINABLE and INLINE pragmas to `Enum Int*` instancesSebastian Graf2021-10-293-4/+64
| | | | | Otherwise the instances aren't good list producers. See Note [Stable Unfolding for list producers].
* Show family TyCons in mk_dict_error in the case of a single matchZiyang Liu2021-10-295-2/+87
|
* hadrian: Turn the `static` flavour into a transformerBen Gamari2021-10-275-63/+54
| | | | | This turns the `static` flavour into the `+fully_static` flavour transformer.
* base: Note export of Data.Tuple.Solo in changelogBen Gamari2021-10-271-1/+4
|
* Compiler dosen't need to know about certain settings from fileJohn Ericson2021-10-274-21/+0
| | | | | | | | | | | | - RTS and libdw - SMP - RTS ways I am leaving them in the settings file because `--info` currently prints all the fields in there, but in the future I do believe we should separate the info GHC actually needs from "extra metadata". The latter could go in `+RTS --info` and/or a separate file that ships with the RTS for compile-time inspection instead.
* Make build system: Generalize and/or document distdirsJohn Ericson2021-10-275-10/+26
| | | | | | | | | `manual-package-config` should not hard-code the distdir, and no longer does Elsewhere, we must continue to hard-code due to inconsitent distdir names across stages, so we document this referring to the existing note "inconsistent distdirs".
* Change CaseAlt and LambdaExpr to FunRhs in deriving Foldable and Traversable ↵Artyom Kuznetsov2021-10-265-3/+70
| | | | (#20496)