summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Drop the orphan roles check (#16941)wip/16941Vladislav Zavialov2019-07-162-38/+13
| | | | | | | | 9366e019 introduced a check for orphan roles to fix #8485 6ab5da99 changed the lookup code and made the check redundant. Now it is removed.
* rts: Rename the nondescript initProfiling2 to refreshProfilingCCSsDaniel Gröber2019-07-163-6/+5
|
* rts: Divorce init of Heap profiler from CCS profilerDaniel Gröber2019-07-164-79/+52
| | | | | | | | | Currently initProfiling gets defined by Profiling.c only if PROFILING is defined. Otherwise the ProfHeap.c defines it. This is just needlessly complicated so in this commit I make Profiling and ProfHeap into properly seperate modules and call their respective init functions from RtsStartup.c.
* Revert "Add support for SIMD operations in the NCG"Ben Gamari2019-07-1645-1512/+246
| | | | | | | Unfortunately this will require more work; register allocation is quite broken. This reverts commit acd795583625401c5554f8e04ec7efca18814011.
* Sort out Hadrian colored output flags (fix #16397)Artem Pelenitsyn2019-07-164-38/+20
| | | | | | | | | | Hadrian used to have a separate flag --progress-colour to control colored output during the build. After introduction of a Shake flag with similar purpose Hadrian's flag became redundant. The commit removes --progress-colour and switches to Shake's flag. The only difference between the two is that Hadrian has special default mode when it tries to determine if the terminal support colored output. The user can override it using (Shake's) `--[no-]color`.
* PV is not P (#16611)Vladislav Zavialov2019-07-152-42/+133
|
* Decouple AddAnn from PVladislav Zavialov2019-07-153-14/+13
|
* Add a note in the simplifier about in-scope set as a substitutionArnaud Spiwack2019-07-153-5/+45
| | | | See also the discussion at #16592
* gitlab-ci: Disable submodule linter for nowBen Gamari2019-07-151-1/+2
|
* primops: haddock: Fix typo in referenced function.Niklas Hambüchen2019-07-141-1/+1
| | | Found by @lehins.
* rename type parameter in `instance Applicative ((->) a)`, fixing #16928xplorld2019-07-144-4/+4
|
* Expunge #ifdef and #ifndef from the codebaseJohn Ericson2019-07-1459-108/+108
| | | | | | | | These are unexploded minds as far as the linter is concerned. I don't want to hit in my MRs by mistake! I did this with `sed`, and then rolled back some changes in the docs, config.guess, and the linter itself.
* Make CPP linter skip certain filesJohn Ericson2019-07-141-0/+7
| | | | | | - docs which document the lint and need to contain the unutterable - vendored code which is outside our purview
* Remove LLVM_TARGET platform macrosJohn Ericson2019-07-147-6/+8
| | | | | Instead following @angerman's suggestion put them in the config file. Maybe we could re-key llvm-targets someday, but this is good for now.
* Don't package settings in bindistBen Gamari2019-07-142-3/+3
| | | | | | | | | | | | Since !712 the `settings` file is produced by the build system instead of autoconf. However, this introduced a subtle bug where we would fail to rebuild the `settings` file with what we have learned from the install-time `configure` invocation. Fix this by not packaging `settings` in the bindist tarball. The build system will take care of the rest. Also fix a bug where the value of `UseLibdw` was not being persisted to the install time `configure`.
* hadrian: Build debug rts with -O0 -g3 and disable rts strippingMatthew Pickering2019-07-142-1/+6
| | | | Fixes #16920
* Remove purely external primopsJohn Ericson2019-07-146-37/+149
| | | | | | | | | | | | The compiler doesn't create uses nor compiles the uses that exist specially. These are just plain C-- FFI. These `await*` ones are especially important to so convert because "true" primops are hard to make platform-specific currently. The other exports are part of this commit so this module always exports something, which avoids silly CPP elsewhere. More will be added later once `foreign import prim` is extended.
* Minor refactoring in CmmBuildInfoTablesÖmer Sinan Ağacan2019-07-131-5/+3
| | | | | - Replace `catMaybes (map ...)` with `mapMaybe ...` - Remove a list->set->list conversion
* Make HsInstances and DynFlags compile with -O0 for Stage0 to speed up ↵James Foster2019-07-131-3/+8
| | | | Hadrian builds (fixes #16936)
* Add two CmmSwitch optimizations.Andreas Klebinger2019-07-134-4/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move switch expressions into a local variable when generating switches. This avoids duplicating the expression if we translate the switch to a tree search. This fixes #16933. Further we now check if all branches of a switch have the same destination, replacing the switch with a direct branch if that is the case. Both of these patterns appear in the ENTER macro used by the RTS but are unlikely to occur in intermediate Cmm generated by GHC. Nofib result summary: -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- Min -0.0% -0.0% -15.7% -15.6% 0.0% Max -0.0% 0.0% +5.4% +5.5% 0.0% Geometric Mean -0.0% -0.0% -1.0% -1.0% -0.0% Compiler allocations go up slightly: +0.2% Example output before and after the change taken from RTS code below. All but one of the memory loads `I32[_c3::I64 - 8]` are eliminated. Instead the data is loaded once from memory in block c6. Also the switch in block `ud` in the original code has been eliminated completely. Cmm without this commit: ``` stg_ap_0_fast() { // [R1] { [] } {offset ca: _c1::P64 = R1; // CmmAssign goto c2; // CmmBranch c2: if (_c1::P64 & 7 != 0) goto c4; else goto c6; c6: _c3::I64 = I64[_c1::P64]; if (I32[_c3::I64 - 8] < 26 :: W32) goto ub; else goto ug; ub: if (I32[_c3::I64 - 8] < 15 :: W32) goto uc; else goto ue; uc: if (I32[_c3::I64 - 8] < 8 :: W32) goto c7; else goto ud; ud: switch [8 .. 14] (%MO_SS_Conv_W32_W64(I32[_c3::I64 - 8])) { case 8, 9, 10, 11, 12, 13, 14 : goto c4; } ue: if (I32[_c3::I64 - 8] >= 25 :: W32) goto c4; else goto uf; uf: if (%MO_SS_Conv_W32_W64(I32[_c3::I64 - 8]) != 23) goto c7; else goto c4; c4: R1 = _c1::P64; call (P64[Sp])(R1) args: 8, res: 0, upd: 8; ug: if (I32[_c3::I64 - 8] < 28 :: W32) goto uh; else goto ui; uh: if (I32[_c3::I64 - 8] < 27 :: W32) goto c7; else goto c8; ui: if (I32[_c3::I64 - 8] < 29 :: W32) goto c8; else goto c7; c8: _c1::P64 = P64[_c1::P64 + 8]; goto c2; c7: R1 = _c1::P64; call (_c3::I64)(R1) args: 8, res: 0, upd: 8; } } ``` Cmm with this commit: ``` stg_ap_0_fast() { // [R1] { [] } {offset ca: _c1::P64 = R1; goto c2; c2: if (_c1::P64 & 7 != 0) goto c4; else goto c6; c6: _c3::I64 = I64[_c1::P64]; _ub::I64 = %MO_SS_Conv_W32_W64(I32[_c3::I64 - 8]); if (_ub::I64 < 26) goto uc; else goto uh; uc: if (_ub::I64 < 15) goto ud; else goto uf; ud: if (_ub::I64 < 8) goto c7; else goto c4; uf: if (_ub::I64 >= 25) goto c4; else goto ug; ug: if (_ub::I64 != 23) goto c7; else goto c4; c4: R1 = _c1::P64; call (P64[Sp])(R1) args: 8, res: 0, upd: 8; uh: if (_ub::I64 < 28) goto ui; else goto uj; ui: if (_ub::I64 < 27) goto c7; else goto c8; uj: if (_ub::I64 < 29) goto c8; else goto c7; c8: _c1::P64 = P64[_c1::P64 + 8]; goto c2; c7: R1 = _c1::P64; call (_c3::I64)(R1) args: 8, res: 0, upd: 8; } } ```
* compiler: trace SysTools commands to emit start/stop eventlog markersAlp Mestanogullari2019-07-131-18/+31
| | | | | | | | | | | | | | | | | | | This patch was motivated by some performance characterization work done for #16822, where we suspected that GHC was spending a lot of time waiting on the linker to be done. (That turned out to be true.) The tracing is taken care of by ErrUtils.withTiming, so this patch just defines and uses a little wrapper around that function in all the helpers for calling the various systools (C compiler, linker, unlit, ...). With this patch, assuming a GHC executable linked against an eventlog-capable RTS (RTS ways that contain the debug, profiling or eventlog way units), we can measure how much time is spent in each of the SysTools when building hello.hs by simply doing: ghc hello.hs -ddump-timings +RTS -l The event names are "systool:{cc, linker, as, unlit, ...}".
* base: Data.Fixed: make HasResolution poly-kinded (#10055, #15622)Ashley Yakeley2019-07-132-6/+17
|
* Add shake 0.18.3 to extra depsShayne Fletcher2019-07-121-0/+1
|
* Fix kind-checking for data/newtypesSimon Peyton Jones2019-07-124-31/+83
| | | | | | | | | | | | | | | | | | | | In one spot in kcConDecl we were passing in the return kind signature rether than the return kind. e.g. #16828 newtype instance Foo :: Type -> Type where MkFoo :: a -> Foo a We were giving kcConDecl the kind (Type -> Type), whereas it was expecting the ultimate return kind, namely Type. This "looking past arrows" was being done, independently, in several places, but we'd missed one. This patch moves it all to one place -- the new function kcConDecls (note the plural). I also took the opportunity to rename tcDataFamHeader to tcDataFamInstHeader (The previous name was consistently a source of confusion.)
* head.hackage: Run builds with -dcore-lintBen Gamari2019-07-111-0/+1
|
* head.hackage: Run build on head.hackage's master branchBen Gamari2019-07-111-1/+1
| | | | The GitLab CI infrastructure is now in the master branch.
* Allow reusing temporary object files generated by GHCi by writing to -odir ↵nineonine2019-07-118-5/+60
| | | | in case -fwrite-interface was specified (#16670)
* Don't typecheck too much (or too little) in DerivingVia (#16923)Ryan Scott2019-07-115-138/+191
| | | | | | | | | | | Previously, GHC would typecheck the `via` type once per class in a `deriving` clause, which caused the problems observed in #16923. This patch restructures some of the functionality in `TcDeriv` and `TcHsType` to avoid this problem. We now typecheck the `via` type exactly once per `deriving` clause and *then* typecheck all of the classes in the clause. See `Note [Don't typecheck too much in DerivingVia]` in `TcDeriv` for the full details.
* Special case a few common patterns in unionLists.Andreas Klebinger2019-07-111-1/+10
| | | | | | | In particular we very often pass one empty list and in these cases we want to avoid the overhead of computing `xs ++ []`. This should fix #14759 and #16911.
* Add regression test for old panic on inlining undeclared identifier (#495)Kevin Buhr2019-07-113-0/+15
|
* Fix erroneous float in CoreOptSimon Peyton Jones2019-07-096-7/+100
| | | | | | | | | | | The simple optimiser was making an invalid transformation to join points -- yikes. The fix is easy. I also added some documentation about the fact that GHC uses a slightly more restrictive version of join points than does the paper. Fix #16918
* hadrian/doc: Add some discussion of compilation stagesBen Gamari2019-07-092-0/+1010
| | | | | This documents some of the lore surrounding the nature and naming of GHC's stage numbers.
* T16804: adjust src spansEric Wolf2019-07-093-157/+161
|
* Add testcase T16804 for #16804Eric Wolf2019-07-096-0/+415
| | | | | slightly larger testcase for :type-at and :uses so we can see changes, if #16804 is done.
* Minor refactoring in CoreSimplÖmer Sinan Ağacan2019-07-091-3/+0
| | | | | | When `join_ids` is empty `extendVarSetList existing_joins join_ids` is already no-op, so no need to check whether `join_ids` is empty or not before extending the joins set.
* Testsuite tweaks and refactoringÖmer Sinan Ağacan2019-07-0910-19/+21
| | | | | | | | | | | | | | | | - Rename requires_th to req_th for consistency with other req functions (e.g. req_interp, req_profiling etc.) - req_th (previously requires_th) now checks for interpreter (via req_interp). With this running TH tests are skipped when running the test suite with stage=1. - Test tweaks: - T9360a, T9360b: Use req_interp - recomp009, T13938, RAE_T32a: Use req_th - Fix check-makefiles linter: it now looks for Makefiles instead of .T files (which are actually Python files)
* Hadrian: fix source-dist ruleAlp Mestanogullari2019-07-091-11/+53
| | | | | | | | | | | | | | | | | The first problem was that the list of files/dirs to embed or ignore was not up-to-date. The second problem was that the 'Cwd' option used when running the Tar builder in the source-dist rule didn't actually change the current directory and was therefore failing. Finally, the source-dist rule did not pre-generate Haskell modules derived from .x (alex) and .y (happy) files, like the Make build system does -- this is now fixed. We might be doing too much work for that last step (we seem to be building many things until we get to generating the source distribution), but extracting the distribution and running ./configure && hadrian/build.sh --flavour=quickest -j from there does work for me now.
* Hadrian: implement key-value settings for builder optionsAlp Mestanogullari2019-07-0911-40/+688
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They take the general form `foo.bar.baz [+]= some values`, where `=` completely overrides the arguments for a builder and `+=` extends them. We currenly only support settings for updating the GHC and C compiler options, of the form: ``` {stage0, ..., stage3 or *}.{package name or *} .ghc.{c, hs, link, deps, toolargs or *}.opts {stage0, ..., stage3 or *}.{package name or *} .cc.{c, deps or *}.opts ``` The supported settings and their use is covered in the new section of `hadrian/doc/user-settings.md`, while the implementation is explained in a new Note [Hadrian settings]. Most of the logic is implemented in a new module, `Settings.Parser`, which contains key-value assignment/extension parsers as well as utilities for specifying allowed settings at a high-level, generating a `Predicate` from such a description or generating the list of possible completions for a given string. The additions to the `Settings` module make use of this to describe the settings that Hadrian currently supports, and apply all such key-value settings (from the command line and `<root>/hadrian.settings`) to the flavour that Hadrian is going to proceed with. This new setting system comes with support for generating Bash completions, implemented in `hadrian/completion.sh` and Hadrian's `autocomplete` target: > source hadrian/completion.sh > hadrian/build.sh stage1.base.ghc.<TAB> stage1.base.ghc.c.opts stage1.base.ghc.hs.opts stage1.base.ghc.*.opts stage1.base.ghc.deps.opts stage1.base.ghc.link.opts stage1.base.ghc.toolargs.opts
* testsuite: Fix #16818Ben Gamari2019-07-091-3/+10
| | | | | Renames performance metrics to include whether they are compile-time or runtime metrics.
* Deduplicate "unique subdir" code between GHC and CabalJohn Ericson2019-07-0911-69/+143
| | | | | | The code, including the generated module with the version, is now in ghc-boot. Config.hs reexports stuff as needed, ghc-pkg doesn't need any tricks at all.
* Remove most uses of TARGET platform macrosJohn Ericson2019-07-099-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These prevent multi-target builds. They were gotten rid of in 3 ways: 1. In the compiler itself, replacing `#if` with runtime `if`. In these cases, we care about the target platform still, but the target platform is dynamic so we must delay the elimination to run time. 2. In the compiler itself, replacing `TARGET` with `HOST`. There was just one bit of this, in some code splitting strings representing lists of paths. These paths are used by GHC itself, and not by the compiled binary. (They are compiler lookup paths, rather than RPATHS or something that does matter to the compiled binary, and thus would legitamentally be target-sensative.) As such, the path-splitting method only depends on where GHC runs and not where code it produces runs. This should have been `HOST` all along. 3. Changing the RTS. The RTS doesn't care about the target platform, full stop. 4. `includes/stg/HaskellMachRegs.h` This file is also included in the genapply executable. This is tricky because the RTS's host platform really is that utility's target platform. so that utility really really isn't multi-target either. But at least it isn't an installed part of GHC, but just a one-off tool when building the RTS. Lying with the `HOST` to a one-off program (genapply) that isn't installed doesn't seem so bad. It's certainly better than the other way around of lying to the RTS though not to genapply. The RTS is more important, and it is installed, *and* this header is installed as part of the RTS.
* Fix two more `#ifndef` for the linterJohn Ericson2019-07-091-2/+2
|
* Fix #16511: changes in interface dependencies should trigger recompilationPhuong Trinh2019-07-0911-32/+160
| | | | | | | If the union of dependencies of imported modules change, the `mi_deps` field of the interface files should change as well. Because of that, we need to check for changes in this in recompilation checker which we are not doing right now. This adds a checks for that.
* Use an empty data type in TTG extension constructors (#15247)Ryan Scott2019-07-0976-2129/+2211
| | | | | | | | | | | | | | | To avoid having to `panic` any time a TTG extension constructor is consumed, this MR introduces an uninhabited 'NoExtCon' type and uses that in every extension constructor's type family instance where it is appropriate. This also introduces a 'noExtCon' function which eliminates a 'NoExtCon', much like 'Data.Void.absurd' eliminates a 'Void'. I also renamed the existing `NoExt` type to `NoExtField` to better distinguish it from `NoExtCon`. Unsurprisingly, there is a lot of code churn resulting from this. Bumps the Haddock submodule. Fixes #15247.
* Add test for old issue w/ bad source locations for warnings in .lhs files (#515)Kevin Buhr2019-07-083-0/+28
|
* Bump Shake and copy instead of hard link from cloud cacheDavid Eichmann2019-07-082-1/+11
| | | | | | | | | This is important as in hard link mode shake makes all such files read only to avoid accidentally modifying cache files via the hard link. It turns out, many Hadrian rules attempt read access to such files and hence fail in the hard link mode. These rules could be refactored to avoid write access, but using copy instead of hard link a much simpler solution.
* Fix #16895 by checking whether infix expression operator is a variablenineonine2019-07-0514-11/+108
|
* More sensible SrcSpans for recursive pattern synonym errors (#16900)Ryan Scott2019-07-054-6/+26
| | | | | | | | Attach the `SrcSpan` of the first pattern synonym binding involved in the recursive group when throwing the corresponding error message, similarly to how it is done for type synonyms. Fixes #16900.
* Make all submodules have absolute URLsArtem Pelenitsyn2019-07-051-27/+27
| | | | | | | | | | | | | The relative URLs were a workaround to let most contributors fork from Github due to a weakness in the haskell.org server. This workaround is no longer needed. And relative submodule URLs are an impediment to forking which makes contributions harder than they should be. The URLs are chosen to clone from https, because this makes sure that anybody, even not a registered Gitlab user, can clone a fork recursively.
* Dont gather ticks when only striping them in STG.Andreas Klebinger2019-07-043-5/+11
| | | | | | | | | Adds stripStgTicksTopE which only returns the stripped expression. So far we also allocated a list for the stripped ticks which was never used. Allocation difference is as expected very small but present. About 0.02% difference when compiling with -O.