summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gitlab-ci: Drop Windows make jobwip/windows-fixesBen Gamari2020-08-241-5/+2
| | | | | | These are a significant burden on our CI resources and end up failing quite often due to #18274. Here I drop the make jobs during validaion; it is now run only during the nightly builds.
* gitlab-ci: Bump Windows toolchain versionBen Gamari2020-08-241-1/+1
| | | | | This should have been done when we bumped the bootstrap compiler to 8.8.4.
* Import qualified Prelude in Cmm/Parser.yVladislav Zavialov2020-08-212-1/+2
| | | | | | | | In preparation for the next version of 'happy', c95920 added a qualified import to GHC/Parser.y but for some reason neglected GHC/Cmm/Parser.y This patch adds the missing qualified import to GHC/Cmm/Parser.y and also adds a clarifying comment to explain why this import is needed.
* Fix -ddump-stg flagSylvain Henry2020-08-216-9/+20
| | | | | | | -ddump-stg was dumping the initial STG (just after Core-to-STG pass) which was misleading because we want the final STG to know if a function allocates or not. Now we have a new flag -ddump-stg-from-core for this and -ddump-stg is deprecated.
* NCG: Dwarf configurationSylvain Henry2020-08-2113-72/+120
| | | | | | * remove references to DynFlags in GHC.CmmToAsm.Dwarf * add specific Dwarf options in NCGConfig instead of directly querying the debug level
* Don't use DynFlags in CmmToAsm.BlockLayout (#17957)Sylvain Henry2020-08-213-22/+28
|
* Put CFG weights into their own module (#17957)Sylvain Henry2020-08-2111-179/+186
| | | | It avoids having to query DynFlags to get them
* Add right-to-left rule for pattern bindingsSimon Peyton Jones2020-08-1914-64/+169
| | | | | | | | | | | | | | | | | | | | | | | Fix #18323 by adding a few lines of code to handle non-recursive pattern bindings. see GHC.Tc.Gen.Bind Note [Special case for non-recursive pattern bindings] Alas, this confused the pattern-match overlap checker; see #18323. Note that this patch only affects pattern bindings like that for (x,y) in this program combine :: (forall a . [a] -> a) -> [forall a. a -> a] -> ((forall a . [a] -> a), [forall a. a -> a]) breaks = let (x,y) = combine head ids in x y True We need ImpredicativeTypes for those [forall a. a->a] types to be valid. And with ImpredicativeTypes the old, unprincipled "allow unification variables to unify with a polytype" story actually works quite well. So this test compiles fine (if delicatedly) with old GHCs; but not with QuickLook unless we add this patch
* Implement -Wredundant-bang-patterns (#17340)nineonine2020-08-199-46/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new flag '-Wredundant-bang-patterns' that enables checks for "dead" bangs. Dead bangs are the ones that under no circumstances can force a thunk that wasn't already forced. Dead bangs are a form of redundant bangs. The new check is performed in Pattern-Match Coverage Checker along with other checks (namely, redundant and inaccessible RHSs). Given f :: Bool -> Int f True = 1 f !x = 2 we can detect dead bang patterns by checking whether @x ~ ⊥@ is satisfiable where the PmBang appears in 'checkGrdTree'. If not, then clearly the bang is dead. Such a dead bang is then indicated in the annotated pattern-match tree by a 'RedundantSrcBang' wrapping. In 'redundantAndInaccessibles', we collect all dead bangs to warn about. Note that we don't want to warn for a dead bang that appears on a redundant clause. That is because in that case, we recommend to delete the clause wholly, including its leading pattern match. Dead bang patterns are redundant. But there are bang patterns which are redundant that aren't dead, for example f !() = 0 the bang still forces the match variable, before we attempt to match on (). But it is redundant with the forcing done by the () match. We currently don't detect redundant bangs that aren't dead.
* DynFlags: refactor GHC.CmmToAsm (#17957, #10143)Sylvain Henry2020-08-1832-503/+644
| | | | | | | | | | | | | | | | | This patch removes the use of `sdocWithDynFlags` from GHC.CmmToAsm.*.Ppr To do that I've had to make some refactoring: * X86' and PPC's `Instr` are no longer `Outputable` as they require a `Platform` argument * `Instruction` class now exposes `pprInstr :: Platform -> instr -> SDoc` * as a consequence, I've refactored some modules to avoid .hs-boot files * added (derived) functor instances for some datatypes parametric in the instruction type. It's useful for pretty-printing as we just have to map `pprInstr` before pretty-printing the container datatype.
* testsuite: Only run llvm ways if llc is availableBen Gamari2020-08-184-19/+14
| | | | | | | | | As noted in #18560, we previously would always run the LLVM ways since `configure` would set `SettingsLlcCommand` to something non-null when it otherwise couldn't find the `llc` executable. Now we rather probe for the existence of the `llc` executable in the testsuite driver. Fixes #18560.
* Expose UnitInfoMap as it is part of the public APIFendor2020-08-181-0/+1
|
* gitlab-ci: Use MR base commit as performance baselineBen Gamari2020-08-184-2/+33
|
* testsuite: Allow baseline commit to be set explicitlyBen Gamari2020-08-184-15/+32
|
* install: do not install sphinx doctreesEli Schwartz2020-08-181-0/+5
| | | | | | These files are 100% not needed at install time, and they contain unreproducible info. See https://reproducible-builds.org/ for why this matters.
* testsuite: Add test for #18291Ben Gamari2020-08-182-0/+8
|
* Allow unsaturated runRW# applicationsBen Gamari2020-08-184-69/+111
| | | | | | | | | | | | | | | | | | Previously we had a very aggressive Core Lint check which caught unsaturated applications of runRW#. However, there is nothing wrong with such applications and they may naturally arise in desugared Core. For instance, the desugared Core of Data.Primitive.Array.runArray# from the `primitive` package contains: case ($) (runRW# @_ @_) (\s -> ...) of ... In this case it's almost certain that ($) will be inlined, turning the application into a saturated application. However, even if this weren't the case there isn't a problem: CorePrep (after deleting an unnecessary case) can simply generate code in its usual way, resulting in a call to the Haskell definition of runRW#. Fixes #18291.
* llvm-targets: Add i686 targetsBen Gamari2020-08-142-0/+6
| | | | Addresses #18422.
* testsuite: Drop --io-manager flag from testsuite configurationBen Gamari2020-08-141-1/+1
| | | | | This is no longer necessary as there are now dedicated testsuite ways which run tests with WinIO.
* Make IOEnv monad one-shot (#18202)Sylvain Henry2020-08-131-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On CI (x86_64-linux-deb9-hadrian, compile_time/bytes_allocated): T10421 -1.8% (threshold: +/- 1%) T10421a -1.7% (threshold: +/- 1%) T12150 -4.9% (threshold: +/- 2%) T12227 -1.6 (threshold: +/- 1%) T12425 -1.5% (threshold: +/- 1%) T12545 -3.8% (threshold: +/- 1%) T12707 -3.0% (threshold: +/- 1%) T13035 -3.0% (threshold: +/- 1%) T14683 -10.3% (threshold: +/- 2%) T3064 -6.9% (threshold: +/- 2%) T4801 -4.3% (threshold: +/- 2%) T5030 -2.6% (threshold: +/- 2%) T5321FD -3.6% (threshold: +/- 2%) T5321Fun -4.6% (threshold: +/- 2%) T5631 -19.7% (threshold: +/- 2%) T5642 -13.0% (threshold: +/- 2%) T783 -2.7 (threshold: +/- 2%) T9020 -11.1 (threshold: +/- 2%) T9961 -3.4% (threshold: +/- 2%) T1969 (compile_time/bytes_allocated) -2.2% (threshold: +/-1%) T1969 (compile_time/max_bytes_used) +24.4% (threshold: +/-20%) Additionally on other CIs: haddock.Cabal -10.0% (threshold: +/- 5%) haddock.compiler -9.5% (threshold: +/- 5%) haddock.base (max bytes used) +24.6% (threshold: +/- 15%) T10370 (max bytes used, i386) +18.4% (threshold: +/- 15%) Metric Decrease: T10421 T10421a T12150 T12227 T12425 T12545 T12707 T13035 T14683 T3064 T4801 T5030 T5321FD T5321Fun T5631 T5642 T783 T9020 T9961 haddock.Cabal haddock.compiler Metric Decrease 'compile_time/bytes allocated': T1969 Metric Increase 'compile_time/max_bytes_used': T1969 T10370 haddock.base
* Add HomeUnit typeSylvain Henry2020-08-1342-392/+672
| | | | | | | | | | | | | | | | | | | | | | | Since Backpack the "home unit" is much more involved than what it was before (just an identifier obtained with `-this-unit-id`). Now it is used in conjunction with `-component-id` and `-instantiated-with` to configure module instantiations and to detect if we are type-checking an indefinite unit or compiling a definite one. This patch introduces a new HomeUnit datatype which is much easier to understand. Moreover to make GHC support several packages in the same instances, we will need to handle several HomeUnits so having a dedicated (documented) type is helpful. Finally in #14335 we will also need to handle the case where we have no HomeUnit at all because we are only loading existing interfaces for plugins which live in a different space compared to units used to produce target code. Several functions will have to be refactored to accept "Maybe HomeUnit" parameters instead of implicitly querying the HomeUnit fields in DynFlags. Having a dedicated type will make this easier. Bump haddock submodule
* Re-add BangPatterns to CodePage.hsHécate2020-08-131-0/+2
|
* PmCheck: Better long-distance info for where bindings (#18533)Sebastian Graf2020-08-1315-146/+211
| | | | | | | | | | | | | | | | | | | | Where bindings can see evidence from the pattern match of the `GRHSs` they belong to, but not from anything in any of the guards (which belong to one of possibly many RHSs). Before this patch, we did *not* consider said evidence, causing #18533, where the lack of considering type information from a case pattern match leads to failure to resolve the vanilla COMPLETE set of a data type. Making available that information required a medium amount of refactoring so that `checkMatches` can return a `[(Deltas, NonEmpty Deltas)]`; one `(Deltas, NonEmpty Deltas)` for each `GRHSs` of the match group. The first component of the pair is the covered set of the pattern, the second component is one covered set per RHS. Fixes #18533. Regression test case: T18533
* parser: Suggest ImportQualifiedPost in prepositive import warningBen Gamari2020-08-132-0/+2
| | | | As suggested in #18545.
* ApiAnnotations: Fix parser for new GHC 9.0 featuresAlan Zimmerman2020-08-121-4/+5
|
* Rewrite and move the monad-state hack noteSylvain Henry2020-08-124-75/+176
| | | | | | The note has been rewritten by @simonpj in !3851 [skip ci]
* testsuite: Increase tolerance of T16916Ben Gamari2020-08-121-1/+1
| | | | | | | | T16916 (testing #16916) has been slightly fragile in CI due to its reliance on CPU times. While it's hard to see how to eliminate the time-dependence entirely, we can nevertheless make it more tolerant. Fixes #16966.
* DynFlags: disentangle OutputableSylvain Henry2020-08-12323-331/+743
| | | | | | | | | - put panic related functions into GHC.Utils.Panic - put trace related functions using DynFlags in GHC.Driver.Ppr One step closer making Outputable fully independent of DynFlags. Bump haddock submodule
* testsuite: Specify metrics collected by T17516Ben Gamari2020-08-111-1/+1
| | | | | | | Previously it collected everything, including "max bytes used". This is problematic since the test makes no attempt to control for deviations in GC timing, resulting in high variability. Fix this by only collecting "bytes allocated".
* Add hie.yaml to ghc-heapSven Tennie2020-08-111-0/+12
| | | | This enables IDE support by haskell-language-server for ghc-heap.
* testsuite: Add test for #18118Ben Gamari2020-08-113-0/+11
|
* typecheck: Drop SPECIALISE pragmas when there is no unfoldingBen Gamari2020-08-111-3/+7
| | | | | | | | Previously the desugarer would instead fall over when it realized that there was no unfolding for an imported function with a SPECIALISE pragma. We now rather drop the SPECIALISE pragma and throw a warning. Fixes #18118.
* Make splitAtList strict in its argumentsSylvain Henry2020-08-101-5/+9
| | | | | | | | | Also fix its slightly wrong comment Metric Decrease: T5030 T12227 T12545
* Add a closing parenthesis tooFelix Yan2020-08-101-1/+1
|
* Correct a typo in ghc.mkFelix Yan2020-08-101-1/+1
|
* Avoid allocations in `splitAtList` (#18535)Sylvain Henry2020-08-091-5/+8
| | | | | | | | | | | | | | | | | | | | | | As suspected by @simonpj in #18535, avoiding allocations in `GHC.Utils.Misc.splitAtList` when there are no leftover arguments is beneficial for performance: On CI validate-x86_64-linux-deb9-hadrian: T12227 -7% T12545 -12.3% T5030 -10% T9872a -2% T9872b -2.1% T9872c -2.5% Metric Decrease: T12227 T12545 T5030 T9872a T9872b T9872c
* Api Annotations : Adjust SrcSpans for prefix bang (!).Alan Zimmerman2020-08-093-4/+6
| | | | | | And prefix ~ (cherry picked from commit 8dbee2c578b1f642d45561be3f416119863e01eb)
* hadrian: depend on boot compiler version #18001Adam Sandberg Ericsson2020-08-091-1/+6
|
* configure: Fix double-negation in ld merge-objects checkBen Gamari2020-08-071-1/+1
| | | | | We want to only run the check if ld is gold. Fixes the fix to #17962.
* ApiAnnotations; tweaks for ghc-exactprint updateAlan Zimmerman2020-08-074-16/+16
| | | | | | Remove unused ApiAnns, add one for linear arrow. Include API Annotations for trailing comma in export list.
* testsuite: Fix prog001Ben Gamari2020-08-071-1/+1
| | | | Previously it failed as the `ghc` package was not visible.
* testsuite: Add test for #18527Ben Gamari2020-08-074-0/+38
|
* nativeGen: One approach to fix #18527Ben Gamari2020-08-072-8/+95
| | | | | | | Previously the code generator could produce corrupt C call sequences due to register overlap between MachOp lowerings and the platform's calling convention. We fix this using a hack described in Note [Evaluate C-call arguments before placing in destination registers].
* CmmLint: Check foreign call argument register invariantBen Gamari2020-08-071-5/+35
| | | | | As mentioned in Note [Register parameter passing] the arguments of foreign calls cannot refer to caller-saved registers.
* cmm: Clean up Notes a bitBen Gamari2020-08-075-8/+12
|
* Add some tests for fail messages in do-expressions and monad-comprehensions.Cale Gibbard2020-08-078-5/+15
|
* A fix to an error message in monad comprehensions, and a move of ↵Cale Gibbard2020-08-074-36/+33
| | | | | | dsHandleMonadicFailure as suggested by comments on !2330.
* users-guide: Rename 8.12 to 9.0Takenobu Tani2020-08-068-9/+9
| | | | | | | | | GHC 8.12.1 has been renamed to GHC 9.0.1. See also: https://mail.haskell.org/pipermail/ghc-devs/2020-July/019083.html [skip ci]
* Use a type alias for WaysSylvain Henry2020-08-064-12/+13
|
* Fail eagerly on a lev-poly datacon argRichard Eisenberg2020-08-064-11/+39
| | | | | | Close #18534. See commentary in the patch.