summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Debug CIwip/ghc-abihashZubin Duggal2022-02-071-1/+3
|
* Always insert abi-depends in ghc-pkgZubin Duggal2022-02-071-2/+2
|
* Debug CIZubin Duggal2022-02-051-0/+1
|
* Fix stage1-testZubin Duggal2022-02-051-5/+7
|
* Fix stage1-testZubin Duggal2022-02-051-6/+4
|
* Fix hpcZubin Duggal2022-02-051-1/+2
|
* Use default flavourZubin Duggal2022-02-051-0/+1
|
* more fixesZubin Duggal2022-02-055-34/+15
|
* reinstallable Setup.hsZubin Duggal2022-02-0591-293/+1205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix cabal file fix cabal file Move CodeGen.Platform.hs to compiler/ make cabal sdist work Remove unnecessary GHC_STAGE guards Remove unnecessary rts dependency hadrian: add 'build-cabal' rule to allow building and testing reinstallable GHC executables ci: add nightly job to test reinstallable GHC test ci REVERT ME Reinstallable ghc-boot + libraries Loader integrity wip (#20742) hadrian: Run custom Setup.hs hadrian: Move logic into Custom Setup.hs WIP hadrian: don't call genapply and genprimops in Custom setup with hadrian Loader integrity wip (#20742) hadrian: Run custom Setup.hs hadrian: Move logic into Custom Setup.hs WIP hadrian: don't call genapply and genprimops in Custom setup with hadrian Add -fdisable-strict-loader-integrity-check Fix hadrian/ghci Misc improvements more fixes more fixes
* hadrian: detect if 'main' is not a haskell file and add it to appropriate ↵Zubin Duggal2022-02-051-3/+13
| | | | list of sources
* primops: Fix documentation of setByteArray#Ben Gamari2022-02-042-5/+8
| | | | | | Previously the documentation was subtly incorrect regarding the bounds of the operation. Fix this and add a test asserting that a zero-length operation is in fact a no-op.
* llvmGen: Handle unaligned loads/storesBen Gamari2022-02-041-7/+7
| | | | | This allows us to produce valid code for indexWord8ArrayAs*# on platforms that lack unaligned memory access.
* Fix array primop alignmentBen Gamari2022-02-042-21/+35
|
* Introduce alignment to CmmStoreBen Gamari2022-02-0418-80/+99
|
* Introduce alignment in CmmLoadBen Gamari2022-02-0426-158/+193
|
* cmm: Introduce cmmLoadBWord and cmmLoadGCWordBen Gamari2022-02-0411-23/+31
|
* Add commentsBen Gamari2022-02-041-0/+2
|
* Drop dead codeBen Gamari2022-02-041-2/+0
|
* Add the Ix class to Foreign C integral typesHécate Moonlight2022-02-045-2/+10
| | | | Related CLC proposal is here: https://github.com/haskell/core-libraries-committee/issues/30
* testsuite: Run testsuite dependency calculation before GHC is builtMatthew Pickering2022-02-0414-81/+212
| | | | | | | | | | | | | | | | | | | | The main motivation for this patch is to allow tests to be added to the testsuite which test things about the source tree without needing to build GHC. In particular the notes linter can easily start failing and by integrating it into the testsuite the process of observing these changes is caught by normal validation procedures rather than having to run the linter specially. With this patch I can run ``` ./hadrian/build test --flavour=devel2 --only="uniques" ``` In a clean tree to run the checkUniques linter without having to build GHC. Fixes #21029
* compiler: Introduce and use RoughMap for instance environmentsBen Gamari2022-02-0460-450/+1063
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we introduce a new data structure, RoughMap, inspired by the previous `RoughTc` matching mechanism for checking instance matches. This allows [Fam]InstEnv to be implemented as a trie indexed by these RoughTc signatures, reducing the complexity of instance lookup and FamInstEnv merging (done during the family instance conflict test) from O(n) to O(log n). The critical performance improvement currently realised by this patch is in instance matching. In particular the RoughMap mechanism allows us to discount many potential instances which will never match for constraints involving type variables (see Note [Matching a RoughMap]). In realistic code bases matchInstEnv was accounting for 50% of typechecker time due to redundant work checking instances when simplifying instance contexts when deriving instances. With this patch the cost is significantly reduced. The larger constants in InstEnv creation do mean that a few small tests regress in allocations slightly. However, the runtime of T19703 is reduced by a factor of 4. Moreover, the compilation time of the Cabal library is slightly improved. A couple of test cases are included which demonstrate significant improvements in compile time with this patch. This unfortunately does not fix the testcase provided in #19703 but does fix #20933 ------------------------- Metric Decrease: T12425 Metric Increase: T13719 T9872a T9872d hard_hole_fits ------------------------- Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
* ci: Add debian 11 jobs (validate/release/nightly)Matthew Pickering2022-02-031-1/+34
| | | | Fixes #21002
* Rewrite CallerCC parser using ReadPMatthew Pickering2022-02-036-14/+63
| | | | | | | | | | This allows us to remove the dependency on parsec and hence transitively on text. Also added some simple unit tests for the parser and fixed two small issues in the documentation. Fixes #21033
* Unbreak T13168 on windowsMatthew Pickering2022-02-031-2/+1
| | | | Fixes #14276
* Remove ghc_plugin_wayMatthew Pickering2022-02-033-46/+32
| | | | | | Using ghc_plugin_way had the unintended effect of meaning certain tests weren't run at all when ghc_dynamic=true, if you delete this modifier then the tests work in both the static and dynamic cases.
* Add flushes to plugin tests which print to stdoutMatthew Pickering2022-02-033-1/+20
| | | | | Due to #20791 you need to explicitly flush as otherwise the output from these tests doesn't make it to stdout.
* Accept new output for T14335 testMatthew Pickering2022-02-031-1/+1
| | | | This test was previously not run due to #20960
* T13168: Filter out rtsopts for consistency between dynamic and static waysMatthew Pickering2022-02-032-5/+1
|
* Filter out -rtsopts in T16219 to make static/dynamic ways agreeMatthew Pickering2022-02-032-7/+1
|
* Mark prog003 as expected_broken on static way #20704Matthew Pickering2022-02-031-0/+1
|
* Don't initialise plugins when there are no pipelines to runMatthew Pickering2022-02-032-2/+4
|
* Frontend01 passes with static GHCMatthew Pickering2022-02-033-10/+1
|
* Add failing test for #20791Matthew Pickering2022-02-032-0/+8
| | | | The test produces different output on static vs dynamic GHC builds.
* Check type first then expressionPeter Trommler2022-02-021-1/+1
|
* Cmm: fix equality of expressionsPeter Trommler2022-02-021-1/+1
| | | | | Compare expressions and types when comparing `CmmLoad`s. Fixes #21016
* More accurate unboxingSimon Peyton Jones2022-02-029-384/+823
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a fix for #20817. It ensures that * The final strictness signature for a function accurately reflects the unboxing done by the wrapper See Note [Finalising boxity for demand signatures] and Note [Finalising boxity for let-bound Ids] * A much better "layer-at-a-time" implementation of the budget for how many worker arguments we can have See Note [Worker argument budget] Generally this leads to a bit more worker/wrapper generation, because instead of aborting entirely if the budget is exceeded (and then lying about boxity), we unbox a bit. Binary sizes in increase slightly (around 1.8%) because of the increase in worker/wrapper generation. The big effects are to GHC.Ix, GHC.Show, GHC.IO.Handle.Internals. If we did a better job of dropping dead code, this effect might go away. Some nofib perf improvements: Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- VSD +1.8% -0.5% 0.017 0.017 0.0% awards +1.8% -0.1% +2.3% +2.3% 0.0% banner +1.7% -0.2% +0.3% +0.3% 0.0% bspt +1.8% -0.1% +3.1% +3.1% 0.0% eliza +1.8% -0.1% +1.2% +1.2% 0.0% expert +1.7% -0.1% +9.6% +9.6% 0.0% fannkuch-redux +1.8% -0.4% -9.3% -9.3% 0.0% kahan +1.8% -0.1% +22.7% +22.7% 0.0% maillist +1.8% -0.9% +21.2% +21.6% 0.0% nucleic2 +1.7% -5.1% +7.5% +7.6% 0.0% pretty +1.8% -0.2% 0.000 0.000 0.0% reverse-complem +1.8% -2.5% +12.2% +12.2% 0.0% rfib +1.8% -0.2% +2.5% +2.5% 0.0% scc +1.8% -0.4% 0.000 0.000 0.0% simple +1.7% -1.3% +17.0% +17.0% +7.4% spectral-norm +1.8% -0.1% +6.8% +6.7% 0.0% sphere +1.7% -2.0% +13.3% +13.3% 0.0% tak +1.8% -0.2% +3.3% +3.3% 0.0% x2n1 +1.8% -0.4% +8.1% +8.1% 0.0% -------------------------------------------------------------------------------- Min +1.1% -5.1% -23.6% -23.6% 0.0% Max +1.8% +0.0% +36.2% +36.2% +7.4% Geometric Mean +1.7% -0.1% +6.8% +6.8% +0.1% Compiler allocations in CI have a geometric mean of +0.1%; many small decreases but there are three bigger increases (7%), all because we do more worker/wrapper than before, so there is simply more code to compile. That's OK. Perf benchmarks in perf/should_run improve in allocation by a geo mean of -0.2%, which is good. None get worse. T12996 improves by -5.8% Metric Decrease: T12996 Metric Increase: T18282 T18923 T9630
* testsuite: Honour PERF_BASELINE_COMMIT when computing allowed metric changesMatthew Pickering2022-02-022-2/+21
| | | | | | | We now get all the commits between the PERF_BASELINE_COMMIT and HEAD and check any of them for metric changes. Fixes #20882
* Replace sndOfTriple with sndOf3Andreas Klebinger2022-02-021-5/+4
| | | | I also cleaned up the imports slightly while I was at it.
* Refactor the escaping kind check for data constructorsSimon Peyton Jones2022-02-022-58/+64
| | | | | | | | | | | | | | As #20929 pointed out, we were in-elegantly checking for escaping kinds in `checkValidType`, even though that check was guaranteed to succeed for type signatures -- it's part of kind-checking a type. But for /data constructors/ we kind-check the pieces separately, so we still need the check. This MR is a pure refactor, moving the test from `checkValidType` to `checkValidDataCon`. No new tests; external behaviour doesn't change.
* Fix @since annotation on NatMorrow2022-02-021-1/+1
|
* Two small improvements in the SimplifierSimon Peyton Jones2022-02-025-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As #20941 describes, this patch implements a couple of small fixes to the Simplifier. They make a difference principally with -O0, so few people will notice. But with -O0 they can reduce the number of Simplifer iterations. * In occurrence analysis we avoid making x = (a,b) into a loop breaker because we want to be able to inline x, or (more likely) do case-elimination. But HEAD does not treat x = let y = blah in (a,b) in the same way. We should though, because we are going to float that y=blah out of the x-binding. A one-line fix in OccurAnal. * The crucial function exprIsConApp_maybe uses getUnfoldingInRuleMatch (rightly) but the latter was deeply strange. In HEAD, if rule-rewriting was off (-O0) we only looked inside stable unfoldings. Very stupid. The patch simplifies. * I also noticed that in simplStableUnfolding we were failing to delete the DFun binders from the usage. So I added that. Practically zero perf change across the board, except that we get more compiler allocation in T3064 (which is compiled with -O0). There's a good reason: we get better code. But there are lots of other small compiler allocation decreases: Metrics: compile_time/bytes allocated --------------------- Baseline Test Metric value New value Change ----------------------------------------------------------------- PmSeriesG(normal) ghc/alloc 44,260,817 44,184,920 -0.2% PmSeriesS(normal) ghc/alloc 52,967,392 52,891,632 -0.1% PmSeriesT(normal) ghc/alloc 75,498,220 75,421,968 -0.1% PmSeriesV(normal) ghc/alloc 52,341,849 52,265,768 -0.1% T10421(normal) ghc/alloc 109,702,291 109,626,024 -0.1% T10421a(normal) ghc/alloc 76,888,308 76,809,896 -0.1% T10858(normal) ghc/alloc 125,149,038 125,073,648 -0.1% T11276(normal) ghc/alloc 94,159,364 94,081,640 -0.1% T11303b(normal) ghc/alloc 40,230,059 40,154,368 -0.2% T11822(normal) ghc/alloc 107,424,540 107,346,088 -0.1% T12150(optasm) ghc/alloc 76,486,339 76,426,152 -0.1% T12234(optasm) ghc/alloc 55,585,046 55,507,352 -0.1% T12425(optasm) ghc/alloc 88,343,288 88,265,312 -0.1% T13035(normal) ghc/alloc 98,919,768 98,845,600 -0.1% T13253-spj(normal) ghc/alloc 121,002,153 120,851,040 -0.1% T16190(normal) ghc/alloc 290,313,131 290,074,152 -0.1% T16875(normal) ghc/alloc 34,756,121 34,681,440 -0.2% T17836b(normal) ghc/alloc 45,198,100 45,120,288 -0.2% T17977(normal) ghc/alloc 39,479,952 39,404,112 -0.2% T17977b(normal) ghc/alloc 37,213,035 37,137,728 -0.2% T18140(normal) ghc/alloc 79,430,588 79,350,680 -0.1% T18282(normal) ghc/alloc 128,303,182 128,225,384 -0.1% T18304(normal) ghc/alloc 84,904,713 84,831,952 -0.1% T18923(normal) ghc/alloc 66,817,241 66,731,984 -0.1% T20049(normal) ghc/alloc 86,188,024 86,107,920 -0.1% T5837(normal) ghc/alloc 35,540,598 35,464,568 -0.2% T6048(optasm) ghc/alloc 99,812,171 99,736,032 -0.1% T9198(normal) ghc/alloc 46,380,270 46,304,984 -0.2% geo. mean -0.0% Metric Increase: T3064
* rts: Address failures to inlineDouglas Wilson2022-02-028-76/+98
|
* Fix a few Note inconsistenciesBen Gamari2022-02-01235-498/+428
|
* Consistently upper-case "Note ["Ben Gamari2022-02-0154-198/+198
| | | | | | This was achieved with git ls-tree --name-only HEAD -r | xargs sed -i -e 's/note \[/Note \[/g'
* Use braces in TH LambdaCase and where clausesElton2022-02-0113-26/+67
| | | | | | This patch ensures that the pretty printer formats LambdaCase and where clauses using braces (instead of layout) to remain consistent with the formatting of other statements (like `do` and `case`)
* Use braces in TH case pprint (fixes #20893)Elton2022-02-014-1/+45
| | | | | | This patch ensures that the pretty printer formats `case` statements using braces (instead of layout) to remain consistent with the formatting of other statements (like `do`)
* Make typechecker trace less strictSimon Peyton Jones2022-01-311-2/+4
| | | | Fixes #21011
* codeGen: Fix two buglets in -fbounds-check logicBen Gamari2022-01-313-10/+30
| | | | | | | @Bodigrim noticed that the `compareByteArray#` bounds-checking logic had flipped arguments and an off-by-one. For the sake of clarity I also refactored occurrences of `cmmOffset` to rather use `cmmOffsetB`. I suspect the former should be retired.
* StgToCmm: decouple DynFlags, add StgToCmmConfigdoyougnu2022-01-3135-650/+805
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | StgToCmm: add Config, remove CgInfoDownwards StgToCmm: runC api change to take StgToCmmConfig StgToCmm: CgInfoDownad -> StgToCmmConfig StgToCmm.Monad: update getters/setters/withers StgToCmm: remove CallOpts in StgToCmm.Closure StgToCmm: remove dynflag references StgToCmm: PtrOpts removed StgToCmm: add TMap to config, Prof - dynflags StgToCmm: add omit yields to config StgToCmm.ExtCode: remove redundant import StgToCmm.Heap: remove references to dynflags StgToCmm: codeGen api change, DynFlags -> Config StgToCmm: remove dynflags in Env and StgToCmm StgToCmm.DataCon: remove dynflags references StgToCmm: remove dynflag references in DataCon StgToCmm: add backend avx flags to config StgToCmm.Prim: remove dynflag references StgToCmm.Expr: remove dynflag references StgToCmm.Bind: remove references to dynflags StgToCmm: move DoAlignSanitisation to Cmm.Type StgToCmm: remove PtrOpts in Cmm.Parser.y DynFlags: update ipInitCode api StgToCmm: Config Module is single source of truth StgToCmm: Lazy config breaks IORef deadlock testsuite: bump countdeps threshold StgToCmm.Config: strictify fields except UpdFrame Strictifying UpdFrameOffset causes the RTS build with stage1 to deadlock. Additionally, before the deadlock performance of the RTS is noticeably slower. StgToCmm.Config: add field descriptions StgToCmm: revert strictify on Module in config testsuite: update CountDeps tests StgToCmm: update comment, fix exports Specifically update comment about loopification passed into dynflags then stored into stgToCmmConfig. And remove getDynFlags from Monad.hs exports Types.Name: add pprFullName function StgToCmm.Ticky: use pprFullname, fixup ExtCode imports Cmm.Info: revert cmmGetClosureType removal StgToCmm.Bind: use pprFullName, Config update comments StgToCmm: update closureDescription api StgToCmm: SAT altHeapCheck StgToCmm: default render for Info table, ticky Use default rendering contexts for info table and ticky ticky, which should be independent of command line input. testsuite: bump count deps pprFullName: flag for ticky vs normal style output convertInfoProvMap: remove unused parameter StgToCmm.Config: add backend flags to config StgToCmm.Config: remove Backend from Config StgToCmm.Prim: refactor Backend call sites StgToCmm.Prim: remove redundant imports StgToCmm.Config: refactor vec compatibility check StgToCmm.Config: add allowQuotRem2 flag StgToCmm.Ticky: print internal names with parens StgToCmm.Bind: dispatch ppr based on externality StgToCmm: Add pprTickyname, Fix ticky naming Accidently removed the ctx for ticky SDoc output. The only relevant flag is sdocPprDebug which was accidental set to False due to using defaultSDocContext without altering the flag. StgToCmm: remove stateful fields in config fixup: config: remove redundant imports StgToCmm: move Sequel type to its own module StgToCmm: proliferate getCallMethod updated api StgToCmm.Monad: add FCodeState to Monad Api StgToCmm: add second reader monad to FCode fixup: Prim.hs: missed a merge conflict fixup: Match countDeps tests to HEAD StgToCmm.Monad: withState -> withCgState To disambiguate it from mtl withState. This withState shouldn't be returning the new state as a value. However, fixing this means tackling the knot tying in CgState and so is very difficult since it changes when the thunk of the knot is forced which either leads to deadlock or to compiler panic.
* Improve migration strategy for the XDG compliance change to the GHC applicationZubin Duggal2022-01-314-59/+111
| | | | | | | | | | | directory. We want to always use the old path (~/.ghc/..) if it exists. But we never want to create the old path. This ensures that the migration can eventually be completed once older GHC versions are no longer in circulation. Fixes #20684, #20669, #20660